feat(informer): ✨ add info for block at given position
This commit is contained in:
parent
2601b7cfb1
commit
8a39596b1d
|
@ -1,9 +1,10 @@
|
|||
let cfg
|
||||
let bot
|
||||
let mcData
|
||||
const v = require('vec3')
|
||||
|
||||
function block() {
|
||||
const block = bot.blockAtCursor()
|
||||
function block(pos) {
|
||||
const block = pos ? bot.blockAt(v(pos)) : bot.blockAtCursor()
|
||||
console.log(block)
|
||||
if (!block) {
|
||||
cfg.quiet || bot.chat("empty")
|
||||
|
@ -38,6 +39,9 @@ function entity(name) {
|
|||
function command(message_parts) {
|
||||
switch (message_parts.length) {
|
||||
case 0:
|
||||
// TODO most recent command?
|
||||
block()
|
||||
break;
|
||||
case 1:
|
||||
switch (message_parts[0]) {
|
||||
case "item":
|
||||
|
@ -54,6 +58,16 @@ function command(message_parts) {
|
|||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
switch (message_parts[0]) {
|
||||
case "block":
|
||||
default:
|
||||
block(message_parts.slice(1))
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user