Optimizing TPS on a Minecraft server
Practical steps to keep a steady 20 TPS: view-distance tuning, paper.yml, mob caps, chunk pre-generation and spark profiling.
TPS (ticks per second) should be 20.0. If it drops to 18, 15 or lower, every player feels rubber-banding and lag. Here's the full playbook.
1. Lower view-distance
In server.properties:
view-distance=8(10 max for public servers)simulation-distance=6
2. Tune paper.yml entity ticking
entities:\n spawning:\n monsters:\n per-player-mob-cap: 30\n animals:\n per-player-mob-cap: 83. Pre-generate chunks
The Chunky plugin pre-generates the world to a radius (e.g. 5000 blocks) overnight. Players later don't trigger generation during play — one of the biggest lag sources eliminated.
4. Mob farms
Large item drops + huge entity counts = tick killer. Limit with mob-spawn-range, alt-item-despawn-rate in paper.yml.
5. Use spark profiler
The spark plugin runs a trace showing exactly which method/mod is eating CPU. Install it, then run /spark profiler --timeout 300 during a lag spike.
6. RAM allocation
More RAM does not mean more TPS. 4 GB is plenty for 20 players. Past 6 GB, Java G1GC pauses get longer and cause micro-stutters.
Use Aikar flags (or ask Wingman AI to "apply Aikar flags") — they're optimized specifically for Minecraft.
7. Remove laggy plugins
Plugins that schedule frequent async tasks (DynMap, old MCMMO, poorly written custom jars) are common culprits. spark profiler will name them.
