Repolode
PrismarineJS

PrismarineJS/mineflayer

A JavaScript API for building Minecraft bots that can join servers, move, dig, craft, chat and interact with the world.

Stars
7,724
Forks
1,547
Open issues
557
Last commit
11 days ago

What is it?

Mineflayer is a Node.js library for creating Minecraft bots. You write a script that connects to a Minecraft server, and the bot can then perceive and act in the game world: tracking entities, querying nearby blocks, moving with physics, managing inventory, crafting, using chests and furnaces, digging and placing blocks, and sending chat messages.

The library supports Minecraft versions from 1.8 through 26.1 and authenticates with Microsoft accounts or offline-mode servers. It is built on the PrismarineJS module family, which handles protocol parsing, block and item data, and the physics engine. The project also documents a Python-usable interface and includes examples for pathfinding, viewing a bot's world in a browser, and connecting a bot to Discord.

A plugin ecosystem extends the base API with pathfinding, PvP, block collection and MCP-based LLM control.

Key features

  • 01Tracks nearby entities and queries blocks in the world.
  • 02Simulates movement and physics for player and vehicle interactions.
  • 03Manages inventory and supports crafting, chests, furnaces and enchantment tables.
  • 04Digs and places blocks, and activates blocks or uses items.
  • 05Supports Minecraft 1.8 through 26.1 with Microsoft or offline authentication.

Use cases

  • Building automated helper bots for a Minecraft server.
  • Prototyping AI agents that play Minecraft through an LLM.
  • Automating repetitive in-game tasks such as farming or building schematics.
  • Learning game automation and protocol handling with Node.js.

Quick start

  1. 1

    Install Node.js 18 or newer from nodejs.org

  2. 2

    Install the mineflayer package

    npm install mineflayer
  3. 3

    Create a bot script and connect it to a server (see the echo example in the README)

Things to know

  • Requires Node.js 18 or newer and writing JavaScript code to control the bot.
  • Microsoft authentication requires a browser sign-in step on first use.

Topics

#minecraft#bot#nodejs#javascript#game-automation#minecraft-bot#minecraft-api#network

FAQ

What is mineflayer?
A JavaScript API for building Minecraft bots that can join servers, move, dig, craft, chat and interact with the world. Mineflayer is a Node.js library for creating Minecraft bots. You write a script that connects to a Minecraft server, and the bot can then perceive and act in the game world: tracking entities, querying nearby blocks, moving with physics, managing inventory, crafting, using chests and furnaces, digging and placing blocks, and sending chat messages.
Is mineflayer free to use? What license does it have?
mineflayer is open source under the MIT license. Check the license terms before using it in commercial products.
Is mineflayer still maintained?
Actively maintained. The last commit to mineflayer was on Oct 27, 2026.
What can I use mineflayer for?
Building automated helper bots for a Minecraft server. Prototyping AI agents that play Minecraft through an LLM. Automating repetitive in-game tasks such as farming or building schematics. Learning game automation and protocol handling with Node.js.
How do I install mineflayer?
Install Node.js 18 or newer from nodejs.org Install the mineflayer package: npm install mineflayer Create a bot script and connect it to a server (see the echo example in the README)
Where can I get mineflayer?
The source code and installation instructions are on GitHub: https://github.com/PrismarineJS/mineflayer

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects