feat(informer): ✨ add info about nearest entities
This commit is contained in:
		| @@ -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 } | ||||
| module.exports = { load, unload, command, block, item, entity } | ||||
		Reference in New Issue
	
	Block a user