Package Exports
- mineflayer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mineflayer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mineflayer
Create Minecraft bots with a powerful, stable, and high level JavaScript API.
Features
- Supports Minecraft 1.4.7.
- Entity knowledge and tracking.
- Block knowledge. You can query the world around you.
- Basic physics and movement - currently blocks are either "solid" or "empty".
- Attacking entities and using vehicles.
- Inventory management.
- Crafting, chests, dispensers, enchantment tables.
- Digging and building.
- Miscellaneous stuff such as knowing your health and whether it is raining.
- Activating blocks and using items.
- Chat.
Roadmap
- Brewing stands, and anvils.
- Better physics (support doors, ladders, water, etc).
Usage
Echo Example
var mineflayer = require('mineflayer');
var bot = mineflayer.createBot({
host: "localhost", // optional
port: 25565, // optional
username: "email@example.com", // email and password are required only for
password: "12345678", // online-mode=true servers
});
bot.on('chat', function(username, message) {
if (username === bot.username) return;
bot.chat(message);
});
More Examples
- In the examples folder.
- vogonistic's REPL bot
Third Party Plugins
Mineflayer is pluggable; anyone can create a plugin that adds an even higher level API on top of Mineflayer.
- navigate - get around easily using A* pathfinding. YouTube Demo
- radar - web based radar interface using canvas and socket.io. YouTube Demo
Projects Using Mineflayer
Installation
Linux / OSX
npm install mineflayer
Windows
- Follow the Windows instructions from node-minecraft-protocol
npm install mineflayer
Documentation
- See doc/api.md.
- See doc/history.md.
- See examples/.
Testing
npm test
Updating to a newer protocol version
- Wait for a new version of mineflayer-protocol to be released which supports the new Minecraft version.
npm install --save minecraft-protocol@latest
- Apply the protocol changes where necessary.
- Run the test suite. See Testing above.