Skip to content

simulatecraft.examples.minecraft_explorer.main

simulatecraft.examples.minecraft_explorer.main

SimulateCraft — Minecraft LLM Explorer example.

Launches one or more LLM-driven bots into a Minecraft server. Each bot has a distinct persona and long-term goal. All bots share the same server; they can see and chat with each other in-game.

Quickest start — free LLM via OpenRouter

# 1. Get a free key at https://openrouter.ai/keys  (takes 30 seconds)
export OPENROUTER_API_KEY=sk-or-...

# 2. Run — auto-selects a free model (Llama 3.1 8B)
python -m simulatecraft.examples.minecraft_explorer.main \
    --host localhost --port 25565 --agents explorer builder

Pick a specific OpenRouter model (free or paid)

SIMULATECRAFT_MODEL="openrouter:meta-llama/llama-3.1-8b-instruct:free" ...
SIMULATECRAFT_MODEL="openrouter:google/gemma-3-27b-it:free" ...
SIMULATECRAFT_MODEL="openrouter:anthropic/claude-sonnet-4.6" ...
# See full list at https://openrouter.ai/models?q=:free

Direct provider keys (if you have them)

SIMULATECRAFT_MODEL="anthropic:claude-sonnet-4-5" ...
SIMULATECRAFT_MODEL="openai:gpt-4o-mini" ...

Offline — no key needed

python -m simulatecraft.examples.minecraft_explorer.main --host localhost
# Uses pydantic-ai TestModel — canned responses, no network calls.

Live browser viewer

python -m simulatecraft.examples.minecraft_explorer.main \
    --host localhost --agents explorer builder gatherer defender \
    --serve --viewer-port 8000
# open http://127.0.0.1:8000

Each bot uses a separate Mineflayer process and IPC port (25570, 25571, ...). Prerequisites: Node.js >= 18 → https://nodejs.org npm install → cd src/simulatecraft/minecraft/bot && npm install