- mineflayer-auto-eat
- Install
- Example
- API
- Properties
- bot.autoEat.disabled
- bot.autoEat.isEating
- bot.autoEat.options
- bot.autoEat.options.priority
- bot.autoEat.options.startAt
- bot.autoEat.options.healthThreshold
- bot.autoEat.options.bannedFood
- bot.autoEat.options.ignoreInventoryCheck
- bot.autoEat.options.checkOnItemPickup
- bot.autoEat.options.eatingTimeout
- bot.autoEat.options.useOffhand
- bot.autoEat.options.equipOldItem
- Methods
- Properties
- Author
- Show your support
Auto eat plugin for mineflayer
npm install mineflayer-auto-eat
const mineflayer = require('mineflayer')
const autoeat = require('mineflayer-auto-eat').plugin
const bot = mineflayer.createBot({
host: process.argv[2],
port: process.argv[3],
username: process.argv[4],
password: process.argv[5]
})
bot.loadPlugin(autoeat)
bot.on('autoeat_started', (item, offhand) => {
console.log(`Eating ${item.name} in ${offhand ? 'offhand' : 'hand'}`)
})
bot.on('autoeat_finished', (item, offhand) => {
console.log(`Finished eating ${item.name} in ${offhand ? 'offhand' : 'hand'}`)
})
bot.on('autoeat_error', console.error)
Boolean value indicating whether auto eat is disabled or not.
Boolean value indicating whether the bot is currently eating or not. This value should never be set manually.
Can be changed to change the settings for the auto eat plugin (Should only be changed when the bot has spawned)
Example
bot.once('spawn', () => {
bot.autoEat.options.priority = 'auto'
bot.autoEat.options.startAt = 14
bot.autoEat.options.bannedFood.push('golden_apple')
})
Acceptable Values are "saturation", "foodPoints" or "auto"
default: "auto"
If the bot has less or equal food points than this value, the bot will start eating
default: 16
If the bot has less or equal health than this value and the bots priority is set to "auto", the bot will prioritize eating food with the highest saturation value and it will temporarily set startAt to 19
The bot will not eat the items in the array.
default: pufferfish, spider_eye, poisonous_potato, rotten_flesh, chorus_fruit, chicken, suspicious_stew, golden_apple
Forces bot to disable inventory window click confirmation. Related to PrismarineJS/mineflayer#2030
default: false
Attempts to eat food when the bot picks up an item and the bot reached the startAt threshold.
default: true
Timeout of food consumption. If eating takes too long, we're assuming that it is finished after that time. Time in milliseconds, null or negative value means "no timeout".
default: 3000
If true, the bot will use the offhand slot to eat food.
default: true
If true, the bot will equip the previous item after eating.
default: true
Calling this function will enable the plugin (its enabled by default ofc)
Calling this function will disable the plugin
If you want to call the eat function manually you can do it like this below
bot.autoEat
// Setting to true will use offhand slot
.eat(true)
.then((successful) => {
console.log('Finished executing eating function', successful)
})
.catch((error) => {
console.error(error)
})
👤 Link
- Github: @link-discord
- Twitter: @link0069
- Discord: @link0069
Give a ⭐️ if this plugin helped you!