Describe a mod or a structure and this terminal agent builds it in Minecraft: ghost preview before placing, one-step undo, datapacks that reload clean, survival materials list.
The project's README from github.com/DolphinStronghold9/ai-minecraft-modmaker. As one markdown file: README.md.
Install · How to use · What makes it different · How it works · FAQ
Mortar is an AI agent in your terminal that builds in your Minecraft world. A small companion mod lets it see where you're standing. It shows the build as a ghost you can walk around, and it only places the blocks when you say yes. One /undo puts everything back. It writes datapacks too.
It's free and open source. Out of the box it runs on a free local model through Ollama; if you already have a key for Claude, GPT or Gemini, it works with that too. No credits, no quotas, no paid tier.
| System | File |
|---|---|
| Windows 10 and 11 | ai-minecraft-modmaker.zip — Main.exe, its settings and mortar |
Unpack the zip and start Main.exe. Keep mortar beside it. Then add the companion for the place you play:
| Where you play | What to install |
|---|---|
| Singleplayer or LAN, Java Edition 26.1–26.3 | The Fabric companion in your mods folder, with Fabric Loader and Fabric API (build it) |
| A Paper server you run | The Paper plugin in plugins (build it). You need to be an operator |
| Minecraft on Rust (Horizon) | Nothing. Turn on Agent Control in Horizon's settings |
mortar in a terminal.› a stone watchtower on this hill, spruce roof, ladder inside
› widen the path to the village to three blocks and light it every 8 blocks
› golden carrots give speed for 10 seconds
The build shows up in your world as see-through blocks that only you can see. Walk around it, look at it from the window of your house, then answer in the terminal. Choose Move or rotate first to shift it a few blocks or turn it before anything is placed.
Before it plans anything, Mortar reads the area around you: the terrain, the biome, the block you're looking at and the builds nearby. A tower lands on the hill instead of floating next to it, and it uses the spruce and cobblestone that are already around instead of a random palette.
Mortar takes a snapshot of the area before every turn. /undo puts back every block the turn touched, including the grass under the footing. Large builds are placed in batches that stay under the game's block-change limit, so nothing gets cut off halfway.
Ask for game rules instead of blocks and Mortar writes a datapack: functions, advancements, recipes or loot tables, with the right pack format for your version. Then it runs /reload, reads the log, fixes what failed and tests it. A pack you didn't want goes away with /undo, like a build.
/materials lists every block a build needs, in stacks and from scratch, smelting included. /export saves it as .litematic, .schem or a structure .nbt, so you can build it by hand or share it.
MORTAR.md in your world folder before every turn. Use it for things like "no builds within 20 blocks of spawn" or "only use blocks from our palette".mortar. It plans each turn with your model, shows what will change and asks before placing.mortar over a WebSocket on localhost and nowhere else.horizon-ctl mcp). Horizon can't draw a ghost in the world yet, so there the preview opens in a window of its own, and placing asks Horizon to confirm..mortar/ inside your world folder.| Command | What it does |
|---|---|
/undo · /redo |
Put back everything the last turn changed, or bring it back |
/move 3 0 -2 · /rotate 90 |
Shift or turn the ghost before placing |
/materials |
Blocks needed, in stacks and from scratch |
/export <file> |
Save the last build as .litematic, .schem or .nbt |
/mode ask · /mode auto |
Ask before every change, or place right away |
/model |
Switch model for this session |
You need Rust 1.85 or newer. The companions need JDK 25.
git clone https://github.com/DolphinStronghold9/ai-minecraft-modmaker.git
cd ai-minecraft-modmaker
cargo build --release # the mortar command
cargo test --workspace
cd companion/fabric && ./gradlew build # the Fabric companion
cd ../paper && ./gradlew build # the Paper plugin
| Path | What's inside |
|---|---|
crates/mortar-cli |
The mortar command: the session, models and the terminal UI |
crates/mortar-core |
Block changes, ghosts, batching and the undo journal |
companion/fabric |
The client companion for Java Edition |
companion/paper |
The server plugin |
examples/MORTAR.md |
An example rules file |
No. Mortar is an independent open-source project. It isn't affiliated with Mojang, Microsoft or the Horizon project.
Only on servers where you're an operator, and only if the server allows it. Mortar never works around permissions. If you can't run /fill, Mortar can't either.
Not today. Mortar supports Java Edition 26.1 to 26.3 through Fabric or Paper, and Minecraft on Rust through Horizon.
Nothing. Mortar is free and open source, and with a local model the whole thing costs $0. If you pick a cloud model, you pay only your provider; Mortar takes nothing.
/undo still works after you log out and back in, because the undo journal is stored in .mortar/ inside your world folder. Run it once per turn to step back further.
It works alongside them. WorldEdit is great when you know the commands, and Litematica shows schematics someone already made. Mortar makes the build from a sentence, shows it as a ghost and exports it as .schem or .litematic, so you can keep using both.
Mortar is MIT licensed.
Minecraft is a trademark of Mojang Synergies AB. Mortar isn't an official Minecraft product and isn't approved by or associated with Mojang or Microsoft.
WorldEdit, Litematica and Claude Code are named for comparison only. Mortar isn't affiliated with their authors or with Anthropic.
Describe a mod or a structure and this terminal agent builds it in Minecraft: ghost preview before placing, one-step undo, datapacks that reload clean, survival materials list.