Where's my Brain (WMB)
A lightweight Minecraft 1.20.1 optimization mod that works with any loader and focuses on intelligent mob AI scheduling, distance-based throttling, and adaptive auto-tuning. Preserves gameplay near players while reducing wasted CPU load from distant or inactive mobs. Compatible with Forge and Fabric via Architectury.
Key Features
Asynchronous Entity Tracking
- Entity visibility and tracking decisions for each player made in separate threads to reduce main thread load
- Global or per-dimension thread pools with adaptive backpressure
- Integration with auto-tuning system for scheduling adjustments under load
- Timeouts and graceful fallbacks for main thread safety
Regional TPS Manager
- Division of dimensions into square regions with continuous load monitoring
- Metric tracking: average AI time, memory usage, player presence, redstone updates
- Application of scalable tick multipliers for each region
- Hysteresis system prevents frequent switching at borderline load values
Distance-based AI Throttling
- Dynamic limitation of AI ticks based on distance to nearest player
- Overrides for specific dimensions and entity types
- Protective exemptions for tamed, named, and important mobs
Proximity Snapshot Service
- Centralization of player distance calculations in periodic snapshots
- Reduction of redundant computations with minimal overhead
Pathfinding Optimization
- Minimum path recalculation intervals for each mob
- Experimental path sharing capability
- Caching with time-to-live to avoid repeated calculations
Auto-Tuning
- PID controller for maintaining target tick time
- Smooth adjustment of path recalculation intervals
- Automatic fallback to simple controller with zero coefficients
Additional Features
- Conservative AI culling for distant and inactive mobs
- Visibility culling for mobs outside player view range
- Built-in metrics and monitoring commands
How It Works
The distance-based AI throttling system continuously distributes mobs into distance categories (near/mid/far/distant) relative to the nearest player and assigns tick interval multipliers for each category.
Asynchronous entity tracking computes tracked entity sets for each player in separate threads and applies updates after ticks. The proximity service creates player position snapshots every N ticks to optimize distance queries.
Auto-tuning monitors average tick time in a window and adjusts minimum path recalculation intervals to achieve the server's target tick time.
Installation
- Minecraft: 1.20.1
- Loaders: Fabric or Forge (via Architectury)
- Place the mod file in the
mods/folder - Launch the game to generate the configuration file
wmb.toml
Configuration location:
- Fabric:
.minecraft/config/wmb.toml - Forge:
<instance>/config/wmb.toml
Commands
/wmb regions here- current region information/wmb regions top [n]- list of most loaded regions/wmb heatmap [radius]- load heatmap around player/wmb reload- configuration reload/wmb stats- system statistics and parameters/wmb tuning on|off- enable/disable auto-tuning
Compatibility
The mod is designed with safety of gameplay-critical AI in mind. Bosses, named, leashed, tamed, and persistent mobs are protected by default. Should be widely compatible with other mods.
FAQ
Does AI throttling affect combat behavior near the player? No. The "near" category typically uses a multiplier of 1, maintaining AI responsiveness at close range.
Does asynchronous tracking cause sudden entity appearance? No. Tracking sets are computed in separate threads but safely applied in the main thread each tick.
Will auto-tuning conflict with manual settings? The tuner only adjusts minimum path recalculation intervals. All other parameters remain unchanged.