Minecraft Bot

Minecraft Bot

yuniko_software
GitHub

About

A Minecraft bot powered by the Mineflayer API that enables AI assistants to control a Minecraft character in real-time. The bot can build structures, explore the world, and interact with the game environment through natural language instructions.

Prerequisites

  • Node.js (>= 20.10.0)
  • A running Minecraft game (tested with Minecraft 1.21.8 Java Edition)
  • Minecraft world opened to LAN

Note: Currently supports Minecraft version 1.21.11. Newer versions may not work until support is added.

Setup

  1. Start Minecraft and create a singleplayer world
  2. Open the world to LAN (ESC -> Open to LAN)
  3. Note the port number (default is 25565)
  4. Configure the MCP server with the correct host and port

Available Commands

Movement

  • get-position - Get the current position of the bot
  • move-to-position - Move to specific coordinates
  • look-at - Make the bot look at specific coordinates
  • jump - Make the bot jump
  • move-in-direction - Move in a specific direction for a duration

Flight

  • fly-to - Make the bot fly directly to specific coordinates

Inventory

  • list-inventory - List all items in the bot's inventory
  • find-item - Find a specific item in inventory
  • equip-item - Equip a specific item

Block Interaction

  • place-block - Place a block at specified coordinates
  • dig-block - Dig a block at specified coordinates
  • get-block-info - Get information about a block
  • find-blocks - Find one or more nearby blocks of a specific type

Furnace

  • smelt-item - Smelt items using a furnace-like block

Entity Interaction

  • find-entity - Find the nearest entity of a specific type

Communication

  • send-chat - Send a chat message in-game
  • read-chat - Get recent chat messages from players

Game State

  • detect-gamemode - Detect the gamemode on game

Usage Tips

  • You can upload images of buildings and ask the bot to build them
  • Make sure to mention "Minecraft" in your prompts to trigger the MCP server
  • Using Claude Sonnet provides the best results for complex tasks
  • It may take some time for the MCP server to boot when starting Claude Desktop