feat(informer): ✨ add more detailed block metadata info
Uses `block.getProperties()`. Thanks to a [comment][1] [1]: https://github.com/PrismarineJS/mineflayer-pathfinder/pull/84/files#r541196424
This commit is contained in:
parent
7b2b936f81
commit
4e7f8d59fd
|
@ -5,13 +5,13 @@ const v = require('vec3')
|
|||
|
||||
function block(pos) {
|
||||
const block = pos ? bot.blockAt(v(pos)) : bot.blockAtCursor()
|
||||
console.log(block)
|
||||
console.log(block, block && block.getProperties())
|
||||
if (!block) {
|
||||
cfg.quiet || bot.chat("empty")
|
||||
return block
|
||||
}
|
||||
let info = [block.type, block.name]
|
||||
if (block.metadata) info.push(block.metadata)
|
||||
if (block.metadata) info.push(Object.entries(block.getProperties()))
|
||||
cfg.quiet || bot.chat(info.join(": "))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user