mineflayer
Create Minecraft bots with a powerful, stable, and high level JavaScript API.
Automatically checked · GitHub checked 2026-11-14

Overview
Create Minecraft bots with a powerful, stable, and high level JavaScript API, also usable from Python. First time using Node.js? You may want to start with the tutorial. Know Python? Checkout some Python examples and try out Mineflayer on Google Colab. Supports Minecraft 1.8 to 26.1 (1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.21.9, 1.21.11, 26.1) Entity knowledge and tracking. Block knowledge. You can query the world around you. Milliseconds to find any block. Physics and movement - handle all bounding boxes 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. A tutorial video explaining the basic set up process for a bot can be found here. If you want to learn more, more video tutorials are there, and the corresponding source codes for those bots is there. Without a version specified, the version of the server will be guessed automatically. Without auth specified, the mojang auth style will be guessed. If auth is set to microsoft, you will be prompted to login to microsoft.com with a code in your browser. After signing in on your browser, the bot will automatically obtain and cache authentication tokens (under your specified username) so you don't have to sign-in again. To switch the account, update the supplied username. By default, cached tokens will be stored in your user's .minecraft folder, or if profilesFolder is specified, they'll instead be stored there. For more information on bot options see node-minecraft-protocol's API doc. To join a Realm that your Minecraft account has been invited to, you can pass a realms object with a selector function like below. A lot of the active development is happening inside of small npm packages which are used by mineflayer. Mineflayer is pluggable; anyone can create a plugin that adds an even higher level API on top of Mineflayer.