1.0.1 • Published 4 years ago

mineflayer-autotem v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

mineflayer-autotem

Auto totem plugin for Mineflayer bots.

Install and load the plugin.

npm i mineflayer-autotem

const autotem = require('mineflayer-autotem');

// load the plugin after you created a bot
bot.loadPlugin(autotem);

Functions

equip

Equips a Totem of Undying to bot's off-hand.

bot.autotem.equip();

totemCount

Returns the number of totems in bot's inventory.

bot.autotem.totemCount();

Example

const mineflayer = require('mineflayer');
const autotem = require('mineflayer-autotem');

const bot = mineflayer.createBot({
  username: 'totem_bot',
  host: process.argv[2],
  port: process.argv[3]
})

bot.loadPlugin(autotem);

bot.on('physicTick', () => {
  bot.autotem.equip();
})

bot.on('chat', (username, message) => {
  if (message === 'totemCount') bot.chat(`I have ${bot.autotem.totemCount()} totems`);
})

Contribute

If you spot a bug, or want to improve this module, please contact me.

1.0.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago