How to Reduce Entity Lag on a Minecraft Server

Reducing Lag

·

Sep 11, 2024

·

15 Mins Read

Entities play a large role in Minecraft gameplay, but they are known for causing lag on servers, regardless of their type. Entity lag occurs when a large number of entities gather in a relatively small space. If left unattended, this abundance of entities can adversely impact server performance and potentially result in chunk corruption.

Please Note

This guide only covers unmodded Minecraft Java Edition servers.

# What are Entities?

In Minecraft, an entity refers to any object that can move, interact with players, store values, or have a non-cuboid shape. When troubleshooting entity lag, it's important to know the difference between the two main types of entities: regular entities and tile entities.


# Tile Entities vs Normal Entities

Regular entities are generally living, humanoid, or simply an item on the ground. Some examples include mobs, items, projectiles, vehicles, and falling blocks. On the other hand, a tile entity is a simplified entity bound to a phyiscal block placed in the world with unique associated data. Some examples of tile entities include a chest's inventory, redstone's power level, or a furnace's smelting logic.

Normal entities tend to cause more lag due to their mobility, involving additional physics like gravity, collisions, and AI. Tile entities, being static blocks, have fewer features and lower lag potential. As a result, a single hopper minecart (Normal entity) can have a greater impact on entity lag than a row of hoppers (Tile entities).


# Reducing Entities to Lessen Entity Lag

Removing excess entities is the simplest and most effective way to reduce entity lag on your server. This can easily be done using a plugin or mod that can automatically handle large amount of entities for you. There are some ways to manually remove entities in Vanilla, although they are far less precise and cannot be automated easily.

You can determine if your server is experiencing entity lag by generating and reviewing a timings report by following this guide.

# Using Plugins

If your Minecraft server uses a server type capable of running plugins like spigot, paper, or purpur, you will have a variety of public plugins available capable of remedying entity lag.

  • ClearLagg - ClearLagg is a great option for helping entity lag as it has many automated tools specializing in just that. Most notably, ClearLagg will remove configured entities on a schedule. For example, you could configure it to remove all dropped items and hostile monsters every 10 minutes.
  • StackMob - StackMob is a great option for servers experiencing a lot of normal entity lag. StackMob will automatically stack configured mobs of the same type nearby each other into one single entity. This reduces the amount of entities the server has to keep track of, improving performance issues caused by entities.

# Without Plugins

If you aren't running a server that can use plugins, like Vanilla, you can remove entities by using some vanilla commands. You can use these vanilla commands to set up your own custom scheduled task.

  • kill @e[type=minecraft:item] - Executing this command will only delete dropped items.
  • kill @e[type=minecraft:REGISTRY_NAME] - Replace REGISTRY_NAME with the registry name for the entity you wish to delete. You can schedule multiple instances of this task to delete hostile mobs.
  • kill @e[type=!player] - Executing this command will delete every entity except players.

If you are still experiencing entity lag on your server, we recommend taking a timings report to identify problematic entities or other potential sources of lag.

Kobe Plane

Game Experience Engineer