The bot drops an item for a player and waits for them to pick it up. Someone else nearby picks up something unrelated. From then on the bot can no longer hear the pickup it is waiting for. The right player collects the gift, and three seconds later the bot reports that the handover failed.
I knew this bug. My own Minecraft bot had done exactly the same thing. This time I found it in someone else’s code: Project AIRI, the open-source AI companion that got me building in the first place.
Where it started
I downloaded AIRI last year. It is a character that lives on your desktop, talks to you, and can join you in games. It made me want a companion of my own, and that became DeskPet, my desktop companion app. AIRI could also play Minecraft with you, but its bot had too many bugs to get through a session. So I built my own Minecraft companion. That project is the subject of my last essay: 43 deaths in one world, then a rebuilt core that decides again at every moment and trusts only what the server says happened.
The whole time, part of the plan was to give it back. If my core worked, maybe AIRI could use it.
A plan that no longer fit
By the time my core was working, AIRI was moving on. The Minecraft section of their repository now opens with a deprecation notice. The Mineflayer bot, the same kind mine is built on, is “expected to be replaced by a Fabric mod based runtime”, and contributors should “avoid building new long-term features around the Mineflayer runtime”.
A 3,100-line core is a long-term feature. It was not what they needed.
What I could give
What I could still give was smaller. Reading their Minecraft code, I kept seeing bugs I had already hit in mine. I recognised them, chose which ones were worth sending, and had an AI coding agent write the pull requests. Four went in between October 25 and 30.
Three of the four had the same shape: an action told the planner something that had not happened.
- Asked to take 96 items from a chest holding stacks of 64 and 32, the bot moved 64 and reported 96.
- The gift bug above: the item arrived, and the bot reported a timeout.
- Asked to equip a shield, the bot put it in its main hand and reported success.
The fourth was about seeing. The code read a food value from a field that items do not have, so when the bot’s health was critical its auto-eat reflex skipped real bread. The tests had always passed, because they gave the items an invented food value. With real items, the old code failed 10 assertions.
In my last essay I wrote that only the server’s result counts, and the bot’s own report does not. These bugs show why. The planner can reason perfectly and still be wrong, because the report it is reasoning about is wrong.
Being corrected
The first pull request, the chest fix, came with 31 regression tests. A reviewer still found a problem in it. They opened a chest holding both stone and cobblestone and asked the bot for stone. It took cobblestone, because the name matching only checked that “cobblestone” contains “stone”. That matching was old code I had kept on purpose, to keep the change small. Some of my own new tests even expected the wrong stack to move. A pull request about reports that do not match the world had its own mismatch, and I only saw it when someone tested it against a real chest. I fixed it two hours later.
On October 29, one of the maintainers left a comment on the food fix: “Hmmm, not correct.” Twenty-seven seconds later, the same maintainer merged the gift fix.
I was a little deflated. Then I went back and reviewed the code myself. The problem I found was in the tests: the fake game data did not match how the real library builds it. I rebuilt the test setup from the real registry, confirmed that the old code still failed and the fix still passed, and asked whether that was what they meant. That pull request is still open, and so is the shield fix.
Being merged
The chest fix was merged two days after I opened it. The gift fix took 32 minutes. I was more excited than I expected to be. AIRI has more than 50,000 stars on GitHub, and some code I had sent was now part of it, accepted by people who had no reason to accept it except that it was right.
Small, correct fixes count
The big contribution I had planned did not happen. The small ones did, and they led somewhere. Last week I offered my core to the AIRI team anyway. The answer was the same: AIRI is moving to Fabric. But this time it came with an invitation to join the next project, moving AIRI’s Minecraft core to a Fabric mod.
I now have open pull requests in airicraft, their experiment with a new kind of Minecraft companion, and in their tool for recording how players move through a world. I am also trying to connect a Fabric mod to my own core.
The lesson I keep: when the big contribution is not what anyone needs, a small, correct one still counts. It has to be narrow, tested and honest about its limits, and it has to survive someone else trying it on a real chest. Sometimes it is also the one that gets you invited back.