Mortar: AI agent builds Minecraft structures from one sentence, with ghost preview
The open-source tool Mortar runs in your terminal and builds whatever you describe in your Minecraft world. It first shows the structure as a transparent "ghost", places it only after you approve, and /undo reverts everything. By default it runs on a free local model via Ollama.

What this is about
GitHub user DolphinStronghold9 has released an AI agent called Mortar that builds in a Minecraft world. The README describes it as "Claude Code for Minecraft": you tell it in the terminal what to build, see a preview, and place it if you like it. The project is free, MIT-licensed and written in Rust. It's available as a portable program for Windows 10 and 11 (current version v1.11.2) and supports Minecraft Java Edition 26.1 to 26.3. It is not a product of Mojang, Microsoft or the Horizon project.
How it works
Mortar has several parts. In the terminal, the mortar command runs. It plans with the language model you choose, shows what would change, and asks before placing anything. A companion connects it to the game:
| Game environment | What you install |
|---|---|
| Singleplayer or LAN | Fabric companion in the mods folder (with Fabric Loader and Fabric API), which you build yourself |
| Your own Paper server | Paper plugin in the plugins folder; you must be an operator |
| Minecraft on Rust (Horizon) | Nothing; enable "Agent Control" in the Horizon settings |
The Fabric companion reads the surroundings and draws the ghost. It talks over a WebSocket (a persistent data connection) to localhost only. With the Paper plugin, the ghost is sent only to you, as glass in the shape of the build, so other players can't see it. Horizon can't draw a ghost in the world yet; there, the preview opens in a separate window, and placement is confirmed through Horizon.
According to the README, every run is a transaction: first a snapshot, then the ghost, then placement, all recorded in an undo journal in the world's .mortar/ folder.
What it can do
- Ghost preview: The build appears as transparent blocks you can walk around. With "Move or rotate first", you can shift or turn it before placing.
- Context from the surroundings: Before planning, Mortar reads the terrain, biome, the block you're looking at and nearby structures. A tower should sit on the hill instead of floating beside it, and use existing materials like spruce and cobblestone.
- One step back:
/undorestores every affected block, including the grass under the foundation. Large builds are placed in batches that stay under the game's block-change limit./redobrings the result back. - Datapacks: For game rules rather than blocks, Mortar writes a datapack (functions, advancements, recipes, loot tables) with the right pack format, runs
/reload, reads the log, fixes errors and tests the effect. Unwanted packs disappear with/undo. - Survival:
/materialslists all required blocks in stacks and as raw materials, including smelting./export <file>saves the build as.litematic,.schemor.nbt.
Example prompts from the README: a stone tower on the hill with a spruce roof and a ladder, a village path widened to three blocks and lit every 8 blocks, or golden carrots that grant speed for 10 seconds.
Other commands include /move, /rotate, /mode ask and /mode auto (ask before every change, or place immediately) and /model to switch models.
Models, rules and privacy
By default, Mortar uses a free local model via Ollama. If you have a key for Claude, GPT or Gemini, you can use those instead; you then pay only the provider, as Mortar doesn't sell tokens. In a MORTAR.md file in the world folder, you can set rules, such as "no builds within 20 blocks of spawn". Mortar can only do what the player could do with commands; on servers, that means you need operator rights. According to the README, there's no telemetry, and network calls go only to the model you choose.
What you need to try it
The ready-made version is for Windows 10/11: unzip it, start Main.exe and leave mortar next to it. You also need Minecraft Java Edition 26.1–26.3 and the matching companion, which the README says you have to build yourself (Rust 1.85+, JDK 25). For the default local model, you need Ollama and, depending on the model, a suitable graphics card or enough RAM; the README gives no specific requirements. Alternatively, use a cloud key, in which case an ordinary PC is enough. Bedrock Edition is not supported. Prebuilt packages for Mac or Linux aren't mentioned, but you can build from source.
Our take
The idea of "AI builds in Minecraft" is less interesting than the safety mechanics: ghost preview, confirmation, snapshots and persistent undo make the agent safe for your own world. It's explicitly designed to work alongside WorldEdit and Litematica. What remains unclear is how good the builds really look with small local models; the README only shows examples and cites no benchmarks or third-party tests. Having to build the companion yourself will likely put off beginners, and the 26.1–26.3 version range is narrow. For Minecraft fans who already use Ollama, it's a promising excursion.
Sources
- GitHub (neue Projekte) github.com
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.