Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Links
Tags
Creators
Details
Brainstem
Vanilla-exact mob AI optimisation for Fabric servers.
Brainstem makes villagers, zombies, farm animals and every other brain-driven mob cheaper to tick. It changes nothing about how they behave: same decisions, same random rolls, same outcomes. It only skips work that provably can't change the result.
Server-side only. Install it on your dedicated server; players don't need it.
Why
We profiled a realistic Fabric server running the popular performance stack (Lithium, C2ME, FerriteCore, ScalableLux, VMP, ServerCore, AlternateCurrent and more). Mob AI was still a major cost on the main thread, and the existing performance mods barely touch it. Villages, iron farms, trading halls, animal pens and zombie-heavy nights are exactly where this shows up.
What it does
🧟 Village goal pruning
At night, zombies try up to 10 random positions every other tick while hunting for a village to walk through. Most of those attempts can never succeed. Brainstem keeps a live index of village centres and skips attempts, or the whole search, when no valid target can exist. The skipped random rolls are still consumed, so the mob's random sequence stays identical to vanilla.
🧠 Behaviour memory gate
Every brain mob re-checks its behaviours every tick: villagers, piglins, hoglins, axolotls, frogs, goats, camels, sniffers, allays, wardens, breezes, armadillos and more. Brainstem pre-checks the pure memory conditions without allocating. Behaviours that can't start are rejected before vanilla builds and evaluates the full trigger tree. About two thirds of all behaviour checks end here.
🔨 Job-site competition index
Villagers regularly scan everyone nearby to see who else claims their workstation. Brainstem tracks job-site claims directly. When there is no rival, which is almost always, the scan is skipped. When there is one, vanilla's logic runs unchanged.
🐄 Tempt scan pruning
Cows, sheep, pigs, chickens, cats and other tempted animals check every player on the server, every tick, for food in their hands. Brainstem first drops players who are provably out of tempt range, so the item check only runs for players close enough to matter. Over 99.9% of those checks are skipped.
🧭 Unreachable-path memory (experimental, off by default)
This remembers "can't reach this" results for villager bed, home and job-site pathfinding, invalidated by block changes. Measurements showed only about 0.1% of path searches repeat exactly, so it stays off. It is kept only for experimentation.
Results
On Minecraft 26.3 with the performance stack, share of main-thread time before → after:
| Hot path | Vanilla logic | With Brainstem |
|---|---|---|
| Zombie Move Through Village goal | 2.7% | 1.0–1.6% |
| Brain behaviour triggers | 4.6% | 3.3% |
| Villager job-site competition scan | 1.4% | 0.1% |
| Animal tempt scan | 1.2% | 0.3% |
Measured with JFR on a fixed-seed, 20-bot SMP scenario. Brainstem's own code costs about 1% of main-thread time.
Be realistic: on an average survival server, chunk generation and entity physics dominate tick time. Brainstem's gain shows up most on servers with many villagers, zombies or farm animals, not as a large drop in overall MSPT everywhere.
Vanilla-exact by design
- No gameplay changes. Every default-on optimisation returns exactly what vanilla would.
- Random rolls are preserved. Per-mob and world random sequences are consumed identically, so seeds, farms and technical contraptions behave the same.
- Verified. Every module was run in verify-all mode against vanilla on SMP and village scenarios: millions of checked calls, 0 mismatches.
- Verify mode for you too. Set
"verify": "sample"or"all"inconfig/brainstem.json. Vanilla and optimised logic then run side by side. On any mismatch the module switches itself off and logs the details. - Per-module toggles. Every optimisation can be turned off individually in the config (
mtvg,oneShotGate,competitorScan,temptScan). Set"stats": trueto collect counters, shown with/brainstem stats.
Compatibility
| Mod | Status |
|---|---|
| Lithium, C2ME, FerriteCore, VMP, ScalableLux, ServerCore, AlternateCurrent, Clumps, Structure Layout Optimizer | ✅ Tested together (verify mode: 0 mismatches) |
| Moonrise | ✅ Tested (0 mismatches). The village goal pruning rarely triggers because of Moonrise's own village tracking. |
| Async | ❌ Marked incompatible. It replaces the random number generator, so exactness can't be guaranteed. |
Requirements
- Minecraft 26.3
- Fabric Loader 0.19.0+
- Dedicated server only
FAQ
Will my iron farm / villager breeder / raid farm still work? Yes. That's the point of vanilla-exact. If you ever find a difference, it's a bug: turn on verify mode and report it.
Does it work in singleplayer? Not currently. Brainstem only loads on dedicated servers.
Is it a replacement for Lithium? No. Use both. Brainstem targets AI hot paths that Lithium doesn't cover.
