@nxg-org/mineflayer-auto-buff
v1.5.0
Published
Automatically applies effects to mineflayer bots using potions.
Readme
mineflayer-auto-buff gives a bot a small, focused API for managing potion effects without having to manually scan inventory, equip potions, drink them, or throw splash potions.
It is built around Mineflayer and minecraft-data, so effect lookup is version-aware and works well for common buff automation flows like:
- Auto-applying strength, speed, regeneration, invisibility, and similar effects
- Re-applying selected buffs when they expire
- Using splash or drinkable potions from inventory
- Restoring the previously held item after buffing
- [X] Buff the bot with one or many named effects
- [X] Apply a specific potion item directly
- [X] Detect available potion items in inventory
- [X] Auto-listen for effect expiry and re-apply configured buffs
- [X] Optional empty bottle dropping
- [X] Optional item restore after buffing
- [ ] Buff other entities
- [ ] Broader potion-name normalization for every edge case
npm install @nxg-org/mineflayer-auto-buff@nxg-org/mineflayer-util-plugin is used internally and is loaded automatically if your bot does not already have it.
import { createBot } from "mineflayer";
import autoBuffPlugin, { Results } from "@nxg-org/mineflayer-auto-buff";
const bot = createBot({
host: "localhost",
port: 25565,
username: "buff-bot"
});
bot.loadPlugin(autoBuffPlugin);
bot.once("spawn", async () => {
const result = await bot.autoBuff.applyEffectsToSelf("strength", "speed");
console.log("Auto buff result:", Results[result]);
});You can also respond to chat commands like the example in examples/basic.ts.
- Effect names should match the plugin's supported effect mapping, such as
strength,speed,regeneration,resistance,invisibility, andinstant health. - Splash potions are thrown at the bot's feet; drinkable potions are consumed normally.
- If
alwaysDrinkisfalse, the plugin skips effects the bot already has. applyEffectsToEntity()currently exists as a placeholder and returnsFAIL.
| Link | Description | | --- | --- | | API | Full API reference for the plugin, class methods, options, and result codes. | | Example | A simple example showing chat-driven self-buff usage. |
This package is published as GPL-3.0 in package.json.
