Blockpilot

Minecraft MCP for development of mods, play-testing, and playing

Documentation

Blockpilot

release game tests

A client-side Minecraft mod that lets AI agents and scripts see and play the game through a fast, token-efficient local interface: to play, or to play-test a mod while you develop it. For Fabric and Forge on Minecraft 1.20.1, NeoForge and Fabric on 1.21.1, 1.21.11, 26.1.2, 26.2 and 26.3, and for plain Minecraft 26.1.2, 26.2 and 26.3 without a mod loader.

A script chops a tree, crafts a crafting table and places it, with the replies below the game

Install

Put the jar for your loader and Minecraft version from the releases into the game's mods folder (Fabric also needs Fabric API) and start the game. The 1.20.1 Forge jar also runs on NeoForge 47.1. Blockpilot runs beside Sodium, and beside Embeddium on 1.20.1 Forge. It listens on 127.0.0.1 only, behind a token it creates. For a mod's dev environment, see docs/dev-environment.md.

Without a mod loader, on Minecraft 26.1.2, 26.2 or 26.3: keep that version's vanilla jar in a folder whose path has no spaces, add an installation of that version in the Minecraft Launcher (or, where it offers that version, a vanilla instance in the CurseForge app) and append -javaagent:<full path to the jar> to its JVM arguments; see docs/connecting.md.

Two ways to drive it

At every start the game writes a launcher, <game dir>/blockpilot/blockpilot (blockpilot.cmd on Windows), that needs nothing else installed. The game dir is ~/Library/Application Support/minecraft on macOS, %APPDATA%\.minecraft on Windows and ~/.minecraft on Linux, or the instance's folder in a launcher such as Prism or CurseForge.

MCP, for AI agents

The launcher serves MCP over stdio. Add it to your agent once; it keeps working through restarts of the game. The agent gets three tools: run (a script of commands), screenshot and help.

claude mcp add --transport stdio blockpilot -- "<game dir>/blockpilot/blockpilot" --mcp

Commands, from a shell or a script

The launcher runs a script of commands, separated by ;, and prints one reply per command. The first err stops the script, and the exit code is 0 when every command answered ok.

"<game dir>/blockpilot/blockpilot" --wait-world "select iron_pickaxe; mine #logs x3; inv"
ok hand:iron_pickaxe
ok mine 3/3 oak_log
ok
  ~ 1:iron_pickaxe dur247/250
  + 5:oak_log x3
! got oak_log x3

Agents see what happens through replies, logs and screenshots, like this screenshot burst=8 every=7t sheet of TNT going off:

Eight frames of a TNT blast in a grid, each labelled with its frame number and game tick

The window can stay in the background. Real keyboard or mouse input stops what the agent is doing, and F8 turns agent control off. MCP over HTTP, the raw line protocol and the launcher's options: docs/connecting.md.

Commands

help <command> in the game gives a command's full form. Commands take an entity as e<id> or by its tag or custom name as @<name>. docs/commands.md is the reference, and docs/command-language.md covers scripts, waits and assertions.

GroupCommandWhat it does
perceptionstatusPosition, health, what the crosshair is on
lookBlocks and entities around the player
entityOne entity's position, motion and updates
findNearest blocks or entities by id, tag, pattern or block state
blockOne block's state and light
blocksThe blocks in a region
invThe inventory
movementfaceAim at a position or entity
turnSet the camera's yaw and pitch
moveWalk a direction for blocks or ticks
jumpJump
sneakSneak, or tap sneak
sprintSprint
flyFly in creative
gotoWalk to a position or entity along a path, through Baritone when it is installed
interactuseUse a block, entity or item
attackHit entities
mineBreak blocks by position or type, walking to them through Baritone when it is installed
placePlace an item against a block
inventoryselectSelect a hotbar slot or item
swapSwap two inventory slots
dropDrop items
offhandMove an item to the offhand
equipPut on armour
openOpen a container
takeTake items from the open container
putPut items into the open container
craftCraft through the recipe book
guiscreenWhat is on screen, with its widgets and slots
cursorMove the mouse pointer
clickClick a widget, slot or point
closeClose the screen
inputmousePress, release or move the mouse
dragDrag with a mouse button
scrollScroll the mouse wheel
keyPress or hold keys and key chords
typeType text
releaseLet go of held keys, buttons and movement
talkchatSend a chat message
cmdSend a command as the player
sessionworldsThe saved worlds
serversThe server list
joinJoin a world or server
leaveLeave the world or server
quitClose the game
respawnRespawn after dying
createCreate a test world
snapshotSave and restore a world's state
deleteDelete a test world
configRead and change NeoForge and Forge mod configs in memory
integratedserverRun a server command and get its output
nbtThe data of a block entity or entity
tickFreeze, step or change the game's tick rate
gametestRun the game's own GameTests and report each one
observescreenshotSave frames, bursts and contact sheets, clean of HUD, overlays and effects
cameraRender from a placed camera: glide, follow, orbit, zoom and tilt, play a shot list, follow a Sable ship
settleWait until the chunks in view have loaded
soundsThe sounds that started or play now
soundPlay a sound on this client, at a position or as an interface sound
messagesChat, action bar and title messages
particlesThe particles spawned, by type or pattern
optionChange video and sound options for a while, or keep every frame clean
pixelsMeasure the colour of parts of the frame
flickerThe brightness of parts of every frame over a time, and how fast they flicker
recordRecord an MP4 with sound (docs/recording.md)
logThe game log
performanceperfCapture server, client and network performance
loadSimulate a busy server, a slow client or a laggy network
metahelpThe reference
fmtText or JSON replies
subPush events and log lines as they happen
stopStop all actions
waitWait some ticks, or until a query matches
sampleRead queries every few ticks, alone or during an action
assertFail the script unless a query matches
ifRun a command only when a query matches
sable (docs)sable:listWith Sable: the ships and other sub-levels nearby
sable:infoA sub-level's pose, speed and height above ground
sable:findBlocks aboard a sub-level
sable:worldA position aboard, in the world
sable:plotA world position, aboard a sub-level
sable:tpPut the player aboard, next to a block

See it build

A lighthouse built block by block through Blockpilot, in Minecraft 26.3 with Fabric. Blockpilot also recorded the video, since it can capture the screen and the game's sound. Next to the game are the commands Blockpilot was sent and what it answered.

blockpilot-lighthouse-readme.mp4

More

Security

  • Player chat reaches agents only from trustedPlayers in config/blockpilot/config.json, empty by default and set in that file only; everyone else's arrives as withheld from=<name>, on screen and in the logs too.
  • agentCommands: "play" in the same file keeps agents from slash commands not in playSlashCommands, other mods' commands not in allowedExtensions, world files, recordings, mod configs, switching servers and quitting.
  • dangerouslyAllowAll: true there turns all of this off, for testing alone only; it is dangerous with other players.
  • Blockpilot can only limit what happens through the game. Keeping the agent off the computer it runs on is the job of the agent's own setup; safety.md shows one for Claude Code.

License

Apache-2.0 or MIT, at your option; see LICENSE-APACHE and LICENSE-MIT. Neither license covers the name Blockpilot: forks need a name of their own.

Baritone, which goto and mine walk through when the player has installed it, is cabaletta's, under LGPL-3.0. Blockpilot neither ships it nor compiles against it: it calls Baritone's public API at run time. Only dev runs with -Pblockpilot.baritone fetch it, from cabaletta's GitHub releases, checked against their checksums.

Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.