Skip to content

How to Reduce Entity Lag on a Minecraft Server

Entities play a crucial role in the gameplay of Minecraft, but they have gained a reputation for causing performance issues on servers, regardless of their type. Lag caused by entities usually happens when there is an abundance of them in a confined space. If this issue is not dealt with, it can significantly impact server performance and even result in chunk corruption.

What are Entities?

In Minecraft, an entity refers to any object that can move, interact with the player, store values, or have a shape that is not a cube. When troubleshooting issues related to entity lag, it’s crucial to understand the distinction between regular entities and tile entities.

Regular vs Tile Entities

The main distinction between these two types of things is whether they exist as solid blocks in the world or not. Regular entities encompass various objects like mobs, dropped items, projectiles, vehicles, and falling blocks. On the other hand, a tile entity represents a block that carries specific unique data, such as the inventory of a chest or the power level of redstone.

Generally, regular entities tend to have a greater impact on performance than tile entities. This is because regular entities are capable of movement and thus require additional physics calculations like gravity, collisions, and AI if needed. In contrast, tile entities are stationary blocks with significantly fewer features and potential performance issues. Therefore, having just one hopper minecart can affect entity performance more than an entire row of hoppers.

Reduce Lag by Removing Entities

Using a Plugin

Removing unnecessary entities is one effective way to reduce entity lag on your server. This can be easily achieved using a plugin like ClearLagg, which automatically eliminates entities and can be customized to protect specific regions or types of entities.

Another option is to utilize a plugin that allows you to blacklist items or entities known for causing entity lag. BanItem is a useful tool that permits you to ban such items and even grants trusted players permission to access blacklisted items. We recommend considering the banning of the following items;

  1. Armor Stands & Item Frames. While these entities primarily serve cosmetic purposes, they can potentially be utilized in creating lag machines.
  2. Redstone Repeaters. These entities have the potential to be employed in lag machines, enabling rapid activation of numerous tile entities.

Implementing these strategies can effectively mitigate entity lag on your server without compromising performance.

Vanilla Commands

If you prefer not to utilize plugins on your server, you have the option to eliminate entities by employing [scheduled tasks](https://help.aleforge.net/article/144-how-do-i-setup-an-automated- backup-of-my-server?preview=659d56003afe0a1c1e4d143a) at specific intervals. Depending on the entities you desire to remove, here are a few examples of tasks and their corresponding outcomes;

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 need further help, please do not hesitate contact the AleForge support team.