Notes9 min
Teaching Minecraft to fight back
Part one: six overnight models that never won a round, one hidden delay, and the model that finally did.

I was bored, I watched a video of someone training a bot to fight in Minecraft, and I wanted my own. Mostly I wanted something to beat up that learned from it.
That is the whole origin of MCRL. I wanted to make my own version and open source it.
The second reason is better. Playing against a bot is fine. Bullying something that actually learns, while it’s learning, is really fun. On day one I asked for exactly that: an instance I could join and fight in while training ran.
The paper is still a draft and I still have training runs to do, so this is part one. It covers how the thing works, and the night it finally stopped losing.
A real server
Most game agents train in a simulator and get moved to the real game afterwards. MCRL skips that. Training runs on an actual Fabric server for Minecraft Java Edition 1.21.11, so vanilla code decides every hit, every knockback and every point of damage. If the bot learns something, it learned it in Minecraft.
A few things had to be true for that to be fair.
The server only moves when told. It blocks at the head of its tick until the trainer grants more ticks, and one call advances every arena together. That allows uncapped training speed, and it makes runs reproducible: a fixed seed replayed 600 ticks with four agents and matched digests on every tick.
Fake players are played, not teleported. Each tick the policy submits one small action struct: look deltas, movement, jump, sneak, sprint, attack. Those become the same packets a real client sends, handed to the same network handler. This has a catch. Vanilla leaves player physics to the client, so a fake player that only receives input packets doesn’t move at all. Movement had to be ported from the client code, line by line.
Attacks resolve through aim. The action has no target field. The policy chooses where to look, and a server-side port of the client’s crosshair raycast decides what that hits. A raycast even slightly more generous than the client’s would land hits no human could.
It can only see what a player sees. The policy gets 833 numbers: its own state, its hotbar, sounds with noisy directions, and the enemy only when the enemy is actually in view. True state exists, on a separate socket that the policy never opens.
| Limit on the policy | Value |
|---|---|
| Field of view | 110° |
| Turn rate | 45° per tick |
| Aim noise | 0.35° |
| Decisions | One per tick, 20 per second |
The policy itself is small. Those 833 numbers go through a 128-unit GRU and out through eight action heads, trained with recurrent PPO. Its memory clears at the end of every round.
What to pay it for
My first instinct was to reward what good players do: crits, jump resets, W-tapping. But pay for a technique and you get a bot that finds a corner and farms the technique. I wanted one that fights really well, which is a different thing.
So the reward pays for winning, and for gaining health over the opponent:
The outcome is for a win and for a loss. The shaping term only pays for improving your position, mostly your health lead, and it can’t be farmed by standing somewhere. A crit or a jump reset is worth exactly the damage it wins or saves.
The draw took longer to notice.

Two agents can both learn that not dying is safe. Now a draw costs , so stalling out a losing fight isn’t a place to hide.
The first model, Devour, had other problems too. Bots on early generations loved looking straight up. Knockback was missing from fake players. Agents kept losing sight of each other. Each of those was a bug in the harness rather than in the learning, and each one got found by watching it.
Getting from 621 to 10,000 decisions per second
I wanted as much simulated experience per hour as the machine could give, so I profiled a live run instead of guessing. At 621 learner decisions per second:
| Share of trainer time | What |
|---|---|
| 69% | The recurrent PPO update: a 64-step Python loop per minibatch |
| 16% | Frozen league opponents, each running one small forward pass per tick |
| 12% | Waiting for the server tick |
| 2.5% | Learner inference |
So the update was the problem. One padded log-softmax replaced eight separate distribution objects. Only the recurrent half of the GRU stays sequential, with a hand-written backward pass checked against autograd. The first layer skips columns that are zero for a whole rollout, which is about 85% of the inputs, since most slots are empty in the Sword kit.
Old and new updates on the same rollout agree to 2e-7, at 7x the speed with equal threads. With more server processes on top, the overnight runs held around 10,000 decisions per second on a laptop i9. The two throughput figures come from different setups, so read them as a rough ratio.
I was beating the teachers
To learn anything, a policy needs opponents, so there are scripted bots at named tiers from low tier 5 up to GOD. I added a mode where the bots wait for me, and I went in to test them.
I beat the hell out of them. The supposed godlike mode was playing like the lowest tier. I was having more fun fighting the scripted bots than the actual AI, and the scripted bots were trash. The AI was worse than trash.
So I threw them out and rewrote them to be properly hard: spacing, combos, and resets, across 36 fighting styles on every tier. A real-server ladder of 60 rounds per pair has each tier beating the one below by 44 to 60 rounds. The new lowest of that set, LT3, beat the old GOD 48-0.
I can’t beat the new GOD. I think of myself as decent, so that’s the bar I wanted.
Tier names here are hand-tuned presets. They’re named after player tiers, and they aren’t measured against any.
The flowers
On the night of 4 October I started the serious attempt: four servers, 128 arenas, around 9,700 decisions per second, 90% of opponents from the new teachers and 10% frozen copies of itself. There was a rule for the night: after 30 million decisions with no tier cleared, save the attempt and restart from an early checkpoint under a new flower name. Results went to Discord, and I went to sleep.
I woke up to this.
12:18 attempt 1 cleared no scripted tier. Attempt 2 (Iris) is restarting.
02:23 attempt 2 cleared no scripted tier. Attempt 3 (Lotus) is restarting.
03:31 supervision halted: trainer exited unexpectedly (code 1).
04:15 attempt 3 cleared no scripted tier. Attempt 4 (Aster) is restarting.
05:14 attempt 4 cleared no scripted tier. Attempt 5 (Marigold) is restarting.
06:16 attempt 5 cleared no scripted tier. Attempt 6 (Peony) is restarting.
06:29 supervision halted: module 'signal' has no attribute 'SIGKILL'.
06:59 run finished. LT3 through GOD: 0 wins, 282 losses, 0 draws.Dahlia, Iris, Lotus, Aster, Marigold, Peony. About 230,000 rounds against those teachers, zero wins. Even a bad bot should get lucky sometimes, so zero is a strange number.
One tick
The cause was in my harness. Input delay was configured as a range, from one to four ticks, to imitate ping. Actions in the queue had to arrive in strictly increasing order. So the first time an agent rolled a delay of four, every action after it got pushed behind that one, and it stayed at four. Permanently. The learner was playing the whole game on 200 ms of lag.
I measured how much that matters by putting scripted bots in the learner’s seat against LT3:
| Bot in the learner’s seat | Delay | Wins vs LT3 |
|---|---|---|
| GOD | 4 ticks | 21% |
| GOD | 2 ticks | 94% |
| LT3 | 0 ticks | 98% |
| LT3 | 1 tick | 42% |
| LT3 | 2 ticks | 3% |
In the last three rows, the same bot goes from winning nearly everything to winning almost nothing across 100 ms. Even GOD lost four out of five from that seat. Six models spent a night trying to learn something nearly impossible, and the reward I’d been tuning wasn’t what was blocking them.
The other half of the diagnosis was the curriculum. There was nothing it could beat. A learner that loses every round gets almost nothing to learn from.
Magnolia
The next night, 5 October, I started over from scratch. New model, new name.
The seat went to a fixed one tick, the same latency as LT3. The goal was modest: at least 60% against LT3, across all styles, from both sides. A foundation to build on later.
The opponents became a ladder: a dummy that stands still, a trash bot that walks at you, three deliberately bad styles, then the low tiers, moving up only after winning. In the seat with it, a GOD bot acted as teacher. Its advice faded out over the run: half of its early decisions came from the teacher, down to none by 25 million steps.
Then I kept watching it and changing things, because it kept telling me where the ladder was wrong. It got stuck on the bad bots because they draw a lot by design, so draws started counting for half. It sat at 0.49 to 0.63 on a level it could clearly beat, because the ladder was judging sampled play while the real policy was much stronger greedy. So a quarter of its rounds became greedy, and only those judged promotion.
Its evaluations through the night:
| Step | LT5 | LT4 | LT3 |
|---|---|---|---|
| 33.3M | 88% | 60% | 0% |
| 67.9M | 100% | 100% | 79% |
| 101.0M | 100% | 96% | 47% |
| 133.7M | 100% | 100% | 92% |
| 171.0M | 100% | 100% | 100% |
| 279.5M | 216-0 | 216-0 | 216-0 |
It went backwards. Win rate against LT3 fell from 79% to 47%, right as the ladder pushed it up into high tier 3 bots with a latency advantage it couldn’t match. Climbing was making it worse. So I saved the best checkpoint and capped the ladder at LT3 for the rest of the night. Two hours later it had 100%.
By morning it had played 279,511,040 steps at about 10,000 per second, through four trainer restarts. It stopped itself at 06:30, ran a final evaluation with frozen weights on all 36 styles from both sides, posted it to Discord, and shut my computer down.
Against LT3, that’s no wins to 216-0 in 24 hours. Most of that came from fixing one delay and giving it someone it could beat.
What that doesn’t mean
216-0 sounds better than it is.
It’s against scripted presets. Magnolia spent its last hours training at exactly that level, on those styles. The evaluation uses fresh rounds and frozen weights, but it isn’t a surprise exam. The ladder is capped at LT3 because it fell apart above that, and I didn’t evaluate anything higher in the final report.
Wins against scripted opponents do not establish a human PvP tier. My own read is that it’s somewhere around low tier 3 to high tier 3 for now, and that’s my read as a player. It isn’t a measurement. It certainly isn’t godlike yet.
It only knows Sword. Other kits load in the harness and have no trainer. It also has one tick of latency and a server to itself, and the real test is putting it on a client against strong players who agreed to it. That hasn’t happened.
Part two
There’s a paper in draft, and it needs better numbers than the ones I have. It needs more training runs, a model that survives contact with high tier 3 bots and GOD, and consent-based human matches. After that, I want to open source the lot.
And I still want to bully it while it learns.