Entities are important to Minecraft gameplay but are notorious for causing lag on any server, regardless of server type. Entity lag occurs when many entities are present in a small area. If not addressed, too many entities can affect server performance and lead to chunk corruption.
What are Entities?
An entity in Minecraft is any object capable of moving, interacting with the player, storing values, or having a non-cuboid shape. When debugging entity lag, it is important to know the two types of entities: regular entities and tile entities.
Tile Entities vs Regular Entities
The main difference between the two types of entities is whether they are a block in the world or not. Regular entities are general objects that consist of mobs, dropped items, projectiles, vehicles, and falling blocks. On the other hand, a tile entity is a block with associated unique data, such as a chest’s inventory and redstone’s power level.
Regular entities generally cause more lag than tile entities. Since regular entities can move around they have a lot of additional physics applied to them such as gravity, collisions, and AI if necessary. Tile entities on the other hand are static blocks and therefore have dramatically fewer features and lag potential. Because of this, one hopper minecart is more impactful on entity lag than a row of hoppers.
Removing Entities to Reduce Entity Lag
Removing excess entities is the simplest way to reduce entity lag on your server. This can easily be done using a plugin. For example, ClearLagg automatically removes entities and can be configured to protect certain regions or entity types.
You can also use a plugin to blacklist items/entities that cause entity lag. BanItem allows you to ban lag-causing items and supports permissions to allow trusted players access to blacklisted items. Some items we suggest banning are:
- Armour Stands & Item Frames - These entities are usually cosmetic but can be used to create lag machines.
- Redstone Repeaters - These entities can be used in lag machines to rapidly activate large amounts of tile entities.
Without Plugins (Vanilla / Modded)
If you do not wish to use plugins on your server, you can remove entities through scheduled tasks at a set interval. Depending on the entities you wish to remove, here are some sample tasks and their effects:
||Executing this command will only delete dropped items.|
||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. You may also consider installing additional plugins on your server to reduce lag.If you require any further assistance, please contact our support at: https://shockbyte.com/billing/submitticket.php