mineflayer-util-plugin
Utility helpers for NextGEN Mineflayer bots.
A focused collection of bot helpers for movement, ray tracing, entity math, inventory handling, prediction, and reusable geometry utilities.
Notably, this has fixes for looking not being synced, better raytracing handling for entities, a predictive world state for simulating client sided blocks, axis-aligned bounding box implementations, and better inventory management to prevent desyncs and more reliably find items in the inventory.
This library exposes the plugin injector at the package root. After injecting it into a Mineflayer bot,
the helpers are available under bot.util.
Quick Start
import mineflayer from "mineflayer";
import inject from "@nxg-org/mineflayer-util-plugin";
const bot = mineflayer.createBot({
host: "localhost",
username: "UtilityBot"
});
inject(bot);
// Helpers are now available under bot.util
const dir = bot.util.getViewDir();
const nearest = bot.util.filters.nearestCrystalFilter();
What Is Included
| Module | Purpose | Docs |
|---|---|---|
UtilFunctions |
Main aggregator attached to bot.util |
docs/utilFunctions.md |
EntityFunctions |
Health, distance, and entity metadata helpers | docs/entityFunctions.md |
FilterFunctions |
Nearest-entity and bot-filtering helpers | docs/filterFunctions.md |
InventoryFunctions |
Inventory lookups and equip helpers | docs/inventoryFunctions.md |
MovementFunctions |
Synchronized look and movement packet helpers | docs/movementFunctions.md |
PredictiveFunctions |
Explosion damage prediction and world overrides | docs/predictiveFunctions.md |
RayTraceFunctions |
Block and entity ray tracing helpers | docs/rayTracingFunctions.md |
AABB, InterceptFunctions, RaycastIterator, AABBUtils, MathUtils, Task |
Public geometry and support utilities exported from the package root | docs/README.md |
Documentation Layout
The full API reference lives in docs/README.md. Each public function file
has its own page inside the docs folder so it is easy to browse module by module.
Notes
- Several helpers are version-sensitive, especially health, armor, and metadata logic.
MovementFunctionslistens to bot spawn and move events to keep look synchronization accurate.PredictiveFunctionsuses a predictive world overlay for explosion estimates.