mc_aiplayer

agent
Security Audit
Fail
Health Pass
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 211 GitHub stars
Code Fail
  • rm -rf — Recursive force deletion command in scripts/food_test.sh
  • rm -rf — Recursive force deletion command in scripts/quickcheck.sh
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Autonomous AI agent that plays Minecraft on its own — a server-side Fabric mod (MC 1.21.3) where a DeepSeek / OpenAI-compatible LLM drives a real player to mine, build, farm, fight and survive from natural-language commands. The LLM plans; deterministic tasks execute.

README.md

AIBot — Autonomous Minecraft AI Player

AIBot

An autonomous AI agent that plays Minecraft.
Tell it once, in plain language — it mines, builds, farms, fights, and survives on its own.

License: MIT Minecraft 1.21.3 Fabric Loader 0.18.4 Java 21 LLM: DeepSeek PRs welcome

English · 简体中文


LLM plans. Tasks execute. Bob survives.

AIBot spawns a real server-side player that perceives the world, back-chains your goal into a complete plan, and carries it out on its own — mining, fighting, farming, surviving.

🤖 What is AIBot?

AIBot is an open-source, autonomous AI agent for Minecraft. It's a server-side Fabric mod for Minecraft 1.21.3 in which a large language model (LLM) — DeepSeek by default, or any OpenAI-compatible model — drives a real in-game player that plays the game on its own.

Give it a goal in plain English or Chinese"mine 3 diamonds", "build a house", "get me some food" — and AIBot perceives the world, plans the dependency-correct steps, and executes them autonomously: mining, crafting, smelting, building, farming, breeding, fighting, fishing, trading, and surviving on any randomly-generated, real-terrain world.

Unlike a hard-coded bot or a script, AIBot splits the brain in two: the LLM decides what to do, and a deterministic engine reliably handles how. It is not a client-side hack or cheat — it spawns a legitimate server-side fake player (in the Carpet-mod tradition) that obeys normal game rules.

Keywords: Minecraft AI · autonomous agent · LLM agent · AI that plays Minecraft · Fabric mod · server-side bot · natural-language game AI · DeepSeek / GPT-style tool-calling agent.

✨ Why AIBot

Most "AI in games" demos either let a language model hallucinate raw actions, or hard-code a rigid script. AIBot does neither — it splits the brain in two:

  • 🧠 The LLM understands intent. You say "mine 3 diamonds"; DeepSeek interprets it and picks from 62 tools.
  • ⚙️ A deterministic engine guarantees execution. A backward-chaining planner expands that goal into a dependency-correct plan, 36 self-contained task state machines run it reliably, and a five-layer safety net keeps the bot alive.

The result is an agent that is flexible enough to take orders in natural language, yet robust enough to actually finish the job.

🎬 See it in action

/aibot brain say Bob mine 3 diamonds

AIBot back-chains the goal into a full plan and executes it step by step:

chop oak → crafting table → wooden pickaxe → mine stone → stone pickaxe
→ descend to Y16 → mine iron → smelt → iron pickaxe → gear up
→ staircase down to Y-59 → ⛏  mine diamonds  ✓

You never hand it a step list. If a step fails, it re-plans. If it's drowning or under attack, it bails out and survives.

🧩 Features

🗣️ Natural-language control Plain English / Chinese commands, understood by a DeepSeek LLM wired to 62 tools.
🎯 Goal back-chaining One goal → a dependency-correct multi-step plan. No manual breakdown.
🧩 LLM + deterministic hybrid The model reasons; the engine executes. Flexible and reliable.
🎒 9 one-shot goals Diamonds, a full iron armor set + sword, a house, a base (table/furnace/chest), cooked food, crops→bread, ore, item stockpiles — each from one command.
🍞 Five food paths Hunt→cook, farm wheat→bread (waits for crops to grow), forage berries, infinite-water irrigation, cake, raid village fields — auto-picked by what's nearby.
🛡️ Unified survival layer Drowning, lava, suffocation, stuck, threats, dark-traps — handled every tick; digs shafts that seal out flooding water.
🧍 Human-like behavior Staircase mining (never straight down), no teleporting, no bunny-hopping.
⛏️ Full survival loop Mine, smelt, craft, fight, hunt, farm, breed, build, fish, trade, sleep, gear up.
🔭 Ore & tree prospecting Palette-level long-range scan locates resources and paths to them.
🌍 Verified on real terrain A multi-seed reliability harness (/aibot verify) proves goals on randomly-generated worlds — not just flat test arenas.
🖥️ Client control panel Alt + 0 opens Bob's panel: health, hunger, task, tokens, inventory, chat.

🏗️ Architecture

One principle: the LLM plans, deterministic tasks execute.

flowchart TB
    P["🎮 Player — natural language · /aibot · Bob panel"] --> B
    subgraph COG["Cognition & Decision"]
      B["🧠 Brain · DeepSeek LLM<br/>62 tools"] --> G["🎯 GoalPlanner<br/>backward-chaining"]
      G --> E["⚙️ GoalExecutor<br/>step state machine"]
    end
    E --> T["🔧 Task FSM ×36<br/>mine · smelt · craft · combat · farm · build …"]
    T --> A["🛠️ Action primitives + A* pathfinding"]
    A --> W["🌍 Minecraft world · Fabric 1.21.3"]
    W -->|perception| B
    S["🛡️ Safety net · every tick<br/>NavSafety → Stuck → Danger → Idle"] -. guards .-> T

164 classes · 30K LOC · 62 tools · 36 task state machines · 9 goal types · 5-layer safety net

🚀 Quick Start

Requirements

Component Version
Minecraft 1.21.3
Fabric Loader 0.18.4+
Fabric API 0.114.1+1.21.3
Yarn Mappings 1.21.3+build.2
Java 21

Build & run

git clone https://github.com/zoyluoblue/mc_aiplayer.git
cd mc_aiplayer

./gradlew build        # build the mod
./gradlew runServer    # dev server
./gradlew runClient    # dev client

Configure the LLM

Provide your DeepSeek API key via environment variable (recommended):

export DEEPSEEK_API_KEY="sk-your-key"

On first run the mod writes aibot.json to the Fabric config directory. You can also set the key, base URL and model there:

{
  "deepseek": { "baseUrl": "https://api.deepseek.com", "model": "deepseek-chat" }
}

Any OpenAI-compatible endpoint works — just point baseUrl at your provider.

🎮 Usage

/aibot spawn Bob                              # spawn an AI player
/aibot list                                   # list active bots
/aibot brain say Bob mine 3 diamonds          # natural-language goal
/aibot task assign Bob mine minecraft:stone 16
/aibot task status Bob                         # inspect / abort a task
/aibot brain status Bob

Press Alt + 0 in-game to open the Bob control panel — track health, hunger, task, brain state, token usage and inventory, and send natural-language messages directly.

🧠 How it works

Layer Package Role
Brain brain DeepSeek tool-calling loop; turns intent into goals & actions
Goal engine goal GoalGoalPlanner (back-chaining) → GoalExecutor (FSM)
Tasks task 36 self-contained state machines, each with its own watchdog
Action / Pathfinding action · pathfinding BlockMiner, DigNav, ActionPack; A* with stand-ability checks
Knowledge craft · mining recipes, mining/smelt chains, tool tiers, ore & tree prospector
Safety net task · coordination BotTickCoordinator: NavSafety → Stuck → Danger → Goal → Idle
Entity entity AIPlayerEntity — a real server-side fake player

📦 Project structure

src/main/java/io/github/zoyluo/aibot
├── action/        # low-level: move, mine, interact, inventory, build
├── brain/         # LLM requests, tool registry, decision coordination
├── command/       # /aibot commands
├── coordination/  # multi-bot task board & idle coordination
├── craft/         # recipes & crafting helpers
├── entity/        # the AI player entity
├── goal/          # declarative goals, planner, executor
├── mining/        # ore scan & long-range prospector
├── pathfinding/   # A* pathfinding & danger checks
├── task/          # deterministic task state machines + safety net
└── …              # log · memory · network · observe · persist · mixin

🛠️ Tech stack

Java 21 · Fabric (Loader 0.18.4, API 0.114.1+1.21.3) · Yarn 1.21.3+build.2 · Gradle · DeepSeek (OpenAI-compatible API).

🗺️ Roadmap

  • Zero-to-hero goals — food (5 paths), full iron armor + sword, house, base, stockpiles
  • Real-terrain reliability harness — /aibot verify · multi-seed success-rate measurement
  • Unified survival layer — drowning / lava / fire / threats + corpse recovery; shaft-flood sealing
  • Natural-language commander hardening — intent→tool wiring regression (tool_dispatch), long-range navigation
  • Reliable deep diamond mining on random terrain
  • Obsidian via water-on-lava (≥15)
  • House completion under night mobs (shed-first / build-by-day)
  • Multi-bot collaboration · long-term memory recall

❓ FAQ

Can an AI play Minecraft on its own?
Yes. AIBot is an autonomous AI agent that plays Minecraft without human input — you give one natural-language goal and it mines, builds, farms, fights, and survives by itself on real-terrain worlds.

How does a large language model (LLM) control a Minecraft bot?
The LLM only decides intent — it emits tool calls like mine_ore or build_house from a 62-tool API. A deterministic engine then back-chains the goal into a dependency-correct plan and runs it with 36 self-contained task state machines, so the bot is flexible enough to take orders yet reliable enough to finish them.

Is AIBot a hack, cheat, or client mod?
No. AIBot is a server-side Fabric mod that spawns a legitimate fake player (in the Carpet-mod tradition) and plays by normal game rules. There is no client-side injection or x-ray.

Which LLMs / AI models does it support?
DeepSeek out of the box, and any OpenAI-compatible endpoint (GPT-style chat + tool-calling) — just point the baseUrl at your provider in aibot.json.

What Minecraft version and mod loader does it need?
Minecraft 1.21.3 on Fabric (Loader 0.18.4+, Fabric API 0.114.1+1.21.3), Java 21.

Can I command the bot in natural language?
Yes — English or Chinese, via chat, the /aibot brain say command, or the in-game control panel (Alt + 0).

Is it open source?
Yes, released under the MIT License.

🤝 Contributing

Issues and PRs are welcome! When touching Minecraft / Fabric API code, mind version compatibility — this project pins Yarn 1.21.3+build.2. Verify method signatures before changing item components, eating, fuel registration, mining speed, furnace inventory, or client networking.

./gradlew clean build   # please make sure this passes before opening a PR

📜 License

Released under the MIT License. © 2026 zoyluo.

🙏 Acknowledgements

Built on Fabric. Natural-language reasoning powered by DeepSeek. Inspired by the Carpet-mod fake-player tradition.


LLM plans · Tasks execute · Bob survives

Reviews (0)

No results found