feat(informer): info about held item(s)

cover
jay 3 years ago
parent 4d21327086
commit 3488a94233
  1. 16
      lib/plugins/informer.js

@ -10,11 +10,25 @@ function block() {
cfg.quiet || bot.chat(info.join(": "))
}
function item(
// hand
loc = bot.quickBarSlot
) {
const item = bot.inventory.slots[loc + bot.QUICK_BAR_START]
console.log(item)
let info = [item.type, item.name]
if (item.metadata) info.push(item.metadata)
cfg.quiet || bot.chat(info.join(": "))
}
function command(message_parts) {
switch (message_parts.length) {
case 0:
case 1:
switch (message_parts[0]) {
case "item":
item()
break
case "block":
default:
block()
@ -39,4 +53,4 @@ const load = (config) => {
const unload = () => {}
module.exports = { load, unload, command, block }
module.exports = { load, unload, command, block, item }
Loading…
Cancel
Save