Mineflayer is a JavaScript library for building Minecraft bots that join a server as a player and act in the world through a high-level API. It runs on Node.js and can also be driven from Python. It supports Minecraft versions from 1.8 through 26.1, guesses the server version automatically when none is given, and authenticates with Microsoft accounts or offline mode, including joining Realms.
A bot knows the entities and blocks around it and can query the world for any block, simulates physics and movement, attacks entities, rides vehicles, manages its inventory, crafts, uses chests, dispensers, and enchantment tables, digs and builds, activates blocks and items, and reads and sends chat. It is event-driven: your code reacts to events such as chat messages, spawns, or being kicked.
Mineflayer is assembled from small PrismarineJS packages that handle the Minecraft protocol, game data, physics, chunks, blocks, items, recipes, and chat, and a plugin ecosystem adds pathfinding, a browser-based live view of what the bot sees, auto-aim, and GUI interaction. It is the basis of LLM agent projects such as Voyager and mindcraft, and a community MCP server exposes Mineflayer to an LLM.
Features
- Version range: Minecraft 1.8 through 26.1, with automatic version detection
- World knowledge: entity tracking and block queries around the bot
- Physics and movement: bounding-box physics, jumping, and riding vehicles
- Combat: attack entities and use items
- Inventory and crafting: manage inventory, craft, and use chests, dispensers, and enchantment tables
- Digging and building: break and place blocks
- Chat: read and send chat messages with event handlers
- Authentication: Microsoft accounts with cached tokens, offline mode, and Realms
- Plugins: pathfinding, a live browser viewer, auto-aim, GUI windows, and an MCP server for LLM control
- Python access: usable from Python as well as JavaScript
