Lag Rules
Last updated
Was this helpful?
Last updated
Was this helpful?
Have you ever noticed mobs moving very slowly or items stuttering in a water stream? If you have, you have experienced server lag. While we have an incredible dedicated server with a plethora of server optimizations, from time to time players build things that the server can't handle.
The key to understanding lag is game ticks. Every second, Minecraft has 20 "ticks" which progresses the game forwards - it spawns mobs, grows crops, moves items, and performs every function in the game. In an ideal world, the server has 20 ticks per second (TPS) and it takes less than or equal to 50 millseconds per tick (MSPT). When the TPS drops below 20 and the MSPT goes above 50, the server is now lagging. If you'd like to see a good estimation of the server's TPS at any given time, you can install MiniHud and turn on infoServerTPS (NB: MiniHud's MSPT reading isn't as accurate as its TPS).
It is important to note that low FPS and high ping are indication of poor client connection, not server lag. If you notice the game stuttering, check your ping first; don't immediately assume the server is lagging.
Some of the main sources of lag to watch out for are:
Entities; i.e., mobs, items, minecarts, etc. Anything that has a hitbox (press f3+b to see hitboxes) is an entity.
Villagers; in moderate to large numbers, their AI can affect server performance.
Hoppers; these check the block above them every game tick. Read below for ways to limit hopper lag.
Pistons; in massive quantities they can cause lag when all firing at once.
Luckily, there are a number of things that you can do to prevent server lag and create a fun playing environment for everyone:
Build sources of lag out of simulation distance from each other. Spreading out your contraptions will reduce collateral lag from having multiple farms loaded at the same time. Additionally, you can build them at build limit, which removes mob spawns, thereby reducing entities.
Run complex redstone contraptions, villager trading halls, or anything that can cause lag at quieter times. If you've built something huge (quarry, higih-speed tree farm, etc.), run it when there aren't many people on. If you like to build these, turn on infoServerTPS in MiniHud and see if the TPS changes when you turn the farm on.
Limit the number of villagers you have. We recommend against villager crop farms - a simple micro crop farm has far better rates with almost no idle lag. Villager trading halls and large iron farms should be out of simulation distance of other builds.
Lock hoppers by powering them with redstone. This is best for things you're planning to build in an area you're frequently in, such as a large smelter in a base. Taking the extra time to work out how tohopper lock a machine when idle is worth the effort.
Cover hoppers with composters where possible. This greatly reduces their lag and you should get in the habit of always doing this. Also, replace long lines of horizontal hoppers with water streams.
Replace hoppers with droppers or decorated pots where possible. For example, if you have a 3 hoppers pointing downward, replace the middle one with a dropper or decorated pot.
Avoid building a large main storage system using basic SS3 filters (also known as Impulse filters). These systems are terrible for yourself and for the server. Go to the Storage Tech discord server to learn more about efficient storage.
Put fires or lava at the end of water streams for farm storage. Don't let items pile up, and never loop items in a water stream until they despawn. If the items don't get picked up the first time, you either need to accept some loss from your farm or design a better storage system for it.
Kill mobs from farms quickly. Don't let them pile up before killing them. Use the f3 screen to see how many entities there are. If you can think of a way to kill them faster, implement it.
If we see you building something that may lag the server, we will ask you to remove or modify it. If you're concerned that something you want to build may cause lag, check with us first. While we don't want to overly limit anyone's creativity, we aim to create a fun playing environment for everyone.