diff --git a/lib/plugins/informer.js b/lib/plugins/informer.js index 675cdd7..c49625e 100644 --- a/lib/plugins/informer.js +++ b/lib/plugins/informer.js @@ -21,6 +21,16 @@ function item( cfg.quiet || bot.chat(info.join(": ")) } +function entity(name) { + const entity = bot.nearestEntity((entity) => { + return name && entity.name ? entity.name == name : true + }) + console.log(entity) + let info = [entity.type, entity.name] + if (entity.metadata) info.push("len: " + entity.metadata.length) + cfg.quiet || bot.chat(info.join("; ")) +} + function command(message_parts) { switch (message_parts.length) { case 0: @@ -29,6 +39,9 @@ function command(message_parts) { case "item": item() break + case "entity": + entity() + break case "block": default: block() @@ -53,4 +66,4 @@ const load = (config) => { const unload = () => {} -module.exports = { load, unload, command, block, item } \ No newline at end of file +module.exports = { load, unload, command, block, item, entity } \ No newline at end of file