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.
This commit is contained in:
parent
94574a4296
commit
288b7045b6
|
@ -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'),
|
||||
|
|
22
lib/plugins/informer.js
Normal file
22
lib/plugins/informer.js
Normal file
|
@ -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…
Reference in New Issue
Block a user