For those in our Discord, we have a community Minecraft server that is available for everyone to play on. I recently noticed when I was near my redstone builds and players were all in different areas of the game that the server became a bit laggy, even though the server specifications are well above what is required for a lag free experience.
I went online to try and find some optimization guides but it seems that a lot of them were dated. Paper is already highly optimized, but there’s actually a few settings you need to change to make Paper run really well for you.
The Critical Optimizations for Paper
The first one is going to be going to your paper-world-defaults.yml and going to find:
redstone-implementation: VANILLA
you’ll want to change that to:
redstone-implementation: alternate-current
There’s another engine you can use called eigencraft. You can use that as well. Looking at the two, alternate-current seems to be the more modern choice.
This is going to drastically increase the performance of your server. Redstone builds can be huge drains on server performance and this allows players to do whatever with redstone without it hampering other players’ experience.
Other Optimizations
There are a few other tweaks you can make that actually have an impact:
keep-spawn-loaded: false
turn to false if you have a lot of redstone at spawn or reduce the keep-spawn-loaded-range to exclude your redstone builds. Alternatively, move spawn away from your redstone builds.
disable-chest-cat-detection: true
This actually helps A LOT as more and more chests are added to the world.
container-update: 2
grass-spread: 2
mob-spawner: 2
Don’t go above 4, but setting these to two really helped my server’s TPS stats!
hopper:
cooldown-when-full: true
disable-move-event: true
ignore-occluding-blocks: false
That also helped! Redstone builds love hoppers and having the hoppers use less resources helps a lot.
That’s it for what helped with lag. There’s a setting to stop a player if a chunk isn’t loaded, but players who are zooming with fly on don’t happen. These changes drastically reduced the CPU load on the server.
Checking Your Stats
You’ll want to use a plugin called: spark.
Type /spark tps to see your servers lag stats.
Type /spark profiler to go online and see everything you could ever want to see about stats.
This helps immensely in identifying rogue plugins that are using too much CPU or memory. It can help you locate the issue and find what’s lagging your server out. Some plugins, like dynmap, can really be a burden.