If your server is experiencing rubber-banding, delayed block breaking, or TPS (Ticks Per Second) dropping below a perfect 20.0, you have a lag problem. This guide will help you optimize your configuration to get your server running smoothly again.
1. Change Your Server Software (Do not use Vanilla)
The single biggest improvement you can make is abandoning the default Mojang Vanilla jar file. It is not optimized for multiplayer environments with lots of players. You should upgrade to:
- Paper: The industry standard. Fixes numerous exploits, memory leaks, and drastically improves multithreading for chunk loading.
- Purpur: A fork of Paper that focuses on additional configurability while maintaining top-tier performance.
2. Reduce View Distance & Simulation Distance
Found in your server.properties file.
- view-distance: Determines how many chunks are sent to the player. In 1.18+, this is pure visual distance. Setting this to 6-8 is recommended for busy servers.
- simulation-distance: Determines which chunks actually process entities (mobs moving, crops growing, redstone ticking). Lowering this is a massive performance boost. Set this to 4 or 5.
3. Optimize Paper Configs (paper-world-defaults.yml)
If you are using Paper, there are specific changes you can make inside the configurations to limit entity CPU usage:
optimize-explosions: true- Uses a faster algorithm for calculate TNT.per-player-mob-spawns: true- Prevents one player's giant mob farm from preventing mobs spawning for everyone else online.despawn-ranges(in spigot.yml) - Lowering the hard and soft despawn ranges helps clear out unused entities faster.
4. Use Aikar's JVM Flags
Java's default garbage collection (GC) can cause sudden lag spikes (freeze-ups) as it clears out old memory. Using Aikar's flags switches Java to the G1GC garbage collector tuned specifically for Minecraft.
Note: If you use a high-quality host like EnderGrid, optimized JVM flags are already applied to your server upon startup, so you don't need to manually configure them!
5. Pre-generate Your World
When players walk into new territory, the server has to mathematically generate mountains, caves, and biomes from scratch. This causes "chunk generation lag".
Use a plugin like Chunky. You can command it to generate a 5,000 x 5,000 block radius around spawn while no one is online, saving those chunks to disk. When players visit those areas later, the server just reads a file instead of doing heavy math.
