fix(informer): 🥅 fix crash for block info when no block or an empty block is found
This commit is contained in:
parent
67932b2f6a
commit
2601b7cfb1
|
@ -5,6 +5,10 @@ let mcData
|
||||||
function block() {
|
function block() {
|
||||||
const block = bot.blockAtCursor()
|
const block = bot.blockAtCursor()
|
||||||
console.log(block)
|
console.log(block)
|
||||||
|
if (!block) {
|
||||||
|
cfg.quiet || bot.chat("empty")
|
||||||
|
return block
|
||||||
|
}
|
||||||
let info = [block.type, block.name]
|
let info = [block.type, block.name]
|
||||||
if (block.metadata) info.push(block.metadata)
|
if (block.metadata) info.push(block.metadata)
|
||||||
cfg.quiet || bot.chat(info.join(": "))
|
cfg.quiet || bot.chat(info.join(": "))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user