Limit Mob Spawns
Reduce lag from mobs piling up.
On this page
Mobs piling up on the server are a common cause of lag and falling TPS. Limiting mob spawns helps keep performance stable.
Settings in server.properties#
| Key | Purpose | Suggested |
|---|---|---|
spawn-limits.monster | Max monsters per player | 70 |
spawn-limits.animals | Max animals per player | 10 |
spawn-limits.water-animals | Max water animals | 5 |
spawn-limits.ambient | Max ambient mobs (bats) | 15 |
spawn-limits.water-ambient | Max water ambient mobs | 5 |
How to change them:
- Open Files →
server.properties. - Adjust the values above.
- Save and Restart the server.
Example:
properties
spawn-limits.monster=70
spawn-limits.animals=10
spawn-limits.water-animals=5
spawn-limits.ambient=15```txt
## Paper/Purpur — Reduce Tick Rates
If using Paper/Purpur, open `config/paper-world-defaults.yml` and enable **mob-spawner-tick-rate** or set `tick-rates` for specific mobs so they are processed less often.
## Clean Up Excess Mobs
To clear mobs that already piled up, run in the **Console**:
/kill @e[type=!player]
```callout-tip
Also cap the **entity count** with a plugin like *ClearLag* for scheduled automatic cleanup.
Signs of Excess Mobs#
- TPS drops below 20 (check with
/tps). - The console shows a "Can't keep up!" warning.
- CPU usage rises when many players are online.
See also the Lag Optimization guide for full tuning.
