feat: add informer plugin to show info

Data and information plugin.
Expose methods in mcData with acceptable ux.
Also central place for all kinds of debug features.
cover
jay 3 years ago
parent 94574a4296
commit 288b7045b6
  1. 1
      lib/index.js
  2. 22
      lib/plugins/informer.js

@ -97,6 +97,7 @@ bot.once("spawn", () => {
command: require('./plugins/command'),
eater: require('./plugins/eater'),
inventory: require('./plugins/inventory'),
informer: require('./plugins/informer'),
finder: require('./plugins/finder'),
sleeper: require('./plugins/sleeper'),
armor: require('./plugins/armor'),

@ -0,0 +1,22 @@
let cfg
let bot
let mcData
function info() {
const block = bot.blockAtCursor()
console.log(block)
cfg.quiet || bot.chat([block.id, block.name])
}
const load = (config) => {
cfg = config
bot = cfg.bot
cfg.info = {
quiet: cfg.quiet,
}
mcData = bot.mcData || (bot.mcData = require('minecraft-data')(bot.version))
}
const unload = () => {}
module.exports = { load, unload, info }
Loading…
Cancel
Save