moincraft
๐ค Mineflayer Core
Mineflayer plugin stack, pathfinding, behavior trees, PvP, and performance rules behind Moincraft bots.
Mineflayer is the protocol/runtime foundation beneath every embodied Moincraft agent.
Essential plugins#
| Plugin | Why it matters |
|---|---|
mineflayer-pathfinder |
Mandatory navigation and goal execution. |
mineflayer-statemachine |
Structured behavior trees instead of if/else sprawl. |
mineflayer-pvp |
Combat timing, shield/crit handling. |
mineflayer-auto-eat |
Survival hygiene. |
mineflayer-collectblock |
Block/resource collection flows. |
mineflayer-armor-manager |
Best-armor auto-equip. |
minecraft-data, prismarine-item, vec3 |
Versioned world/item/vector primitives. |
Bot creation baseline#
- keep swarm bots headless and cheap;
- prefer
viewDistance: "tiny"for non-explorer roles; - disable unnecessary physics/listeners when a bot is mostly idle;
- always wire
kickedanderrorhandlers.
Navigation rules#
- Load
pathfinderonce. - Use explicit goals like
GoalNear,GoalBlock, andGoalFollow. - Tune movements deliberately: avoid lava, protect containers, cap dangerous drops, and only allow digging/parkour when intended.
- Stop navigation explicitly before conflicting actions.
State machine posture#
Use state machines for multi-step behavior transitions. Idle, follow, gather, defend, and recover should be states with explicit transition predicates.
Performance rules for swarms#
- Do not run many bots in one Node process.
- Keep chat regexes and listeners minimal.
- Lower view distance for non-visual roles.
- Disable costly features when inactive.
- Separate heavy pathfinding from unrelated agents by process.
Sources: wiki/content/docs/mineflayer.md, moincraft/docs/bot-architecture.md, moincraft/SKILLS.md.