How to use the mineflayer.Item function in mineflayer

To help you get started, we’ve selected a few mineflayer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PrismarineJS / mineflayer / examples / chatterbox.js View on Github external
bot.on('playerCollect', (collector, collected) => {
  if (collector.type === 'player' && collected.type === 'object') {
    const rawItem = collected.metadata[10]
    const item = mineflayer.Item.fromNotch(rawItem)
    bot.chat(`${collector.username !== bot.username ? ("I'm so jealous. " + collector.username) : 'I '} collected ${item.count} ${item.displayName}`)
  }
})

mineflayer

create minecraft bots with a stable, high level API

MIT
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis

Similar packages