Cut entity and mob lag on your server
Entities are the single most common cause of low TPS: every mob, dropped item and armor stand has to be updated on every tick, so counting them and capping the worst offenders is usually the fastest win available.
6 min read · Updated Oct 21, 2026 · By GuavaHost Team
What counts as an entity
An entity is anything in the world that is not a block: mobs, dropped items, experience orbs, arrows, boats, minecarts, item frames and armor stands. Block entities (also called tile entities) are the halfway cases, blocks that still need code run on them: chests, hoppers, furnaces, spawners, beacons.
The server updates all of them every tick, twenty times a second. One entity is free. Four thousand entities in a single chunk is a slideshow. That is the whole problem in one sentence.
Why entities hurt more than anything else
Three reasons stack up:
- The work is per entity, per tick. Double the mobs and you roughly double the cost.
- It runs on the main thread, the one thread that also handles redstone, block updates and player actions, so there is nowhere for it to hide. What a server tick actually is explains why that single thread matters so much.
- Entities collide. Mobs crammed into one block push against each other, and that check grows with the number of neighbours, not linearly.
If your MSPT (milliseconds per tick) is high and a profile points at entity ticking, this guide is your fix list. If you have not measured yet, start with Reading TPS and MSPT and spark.
Count what you actually have
Guessing is a waste of time, so get numbers first.
- On recent Paper builds, run
paper entity listin the Console tab (console commands are typed without a slash). It counts every entity type in the loaded world and gives chunk coordinates for the biggest clusters. - On any server with spark installed, the
Server threadtree in a profile shows which entity types are eating the time. - In game, press F3 and read the
E:line for an instant smell test.
You are looking for one chunk with hundreds of entities in it. That is nearly always where the lag comes from.
Dropped items and experience orbs
These are the easiest to fix and the most common. A mob farm with no collection system, or a player who died in lava, can leave a pile costing ticks forever.
- Clear them:
kill @e[type=item]in the Console removes every dropped item in loaded chunks. Warn players first, because it takes their loose drops too. - Put it on a timer. Add a Scheduled task that runs a console command on an interval, or use a plugin that clears items with a countdown in chat.
- Cap what gets saved. In Paper's
config/paper-world-defaults.yml,chunks.entity-per-chunk-save-limitstops piles of arrows and orbs being written back into a chunk forever. Optimize Paper for performance has the values. - Merge drops.
merge-radiusinspigot.ymlturns many item entities into fewer stacks. Raise it a little, not a lot, or items merge through walls.
Mob caps and spawn ranges
Two settings decide how many mobs exist at all, and both live in bukkit.yml:
spawn-limits:
monsters: 50
animals: 8
water-animals: 3
ambient: 1
ticks-per:
monster-spawns: 5
spawn-limits caps each category. On Paper, per-player mob spawning is on by default, so these apply per player rather than per world. ticks-per.monster-spawns is how often the server tries to spawn monsters at all; the default of 1 means every single tick, and 5 or 10 costs very little in gameplay.
In spigot.yml, under world-settings: default::
mob-spawn-range: keep it at or below yoursimulation-distance, so you are not spawning mobs in chunks that are frozen anyway.entity-activation-range: entities further from a player than this tick far less often. Loweringanimalsto around16,monstersto24andmiscto8is a large saving, but the trade-off is real: farms that depend on mobs acting while nobody is nearby will slow down or stop.
Change one of these, restart, and measure. Change them all at once and you cannot tell which one helped.
Entity cramming
Vanilla has a brake for stacked mobs already. The maxEntityCramming game rule kills entities squeezed into one block beyond its value, and the default of 24 is generous.
gamerule maxEntityCramming 8
That keeps farms and animal pens working while stopping anyone building a thousand-cow tower. Setting it to 0 disables cramming deaths entirely, which is the wrong direction. Tell your players first, because it kills the overflow in existing pens.
Hopper chains and block entities
Hoppers are the quiet killer. Every one checks the block above it and the container in front of it constantly, whether anything is moving or not, so a hundred-hopper sorter costs tick time around the clock.
- Use fewer hoppers. Replace long transport lines with water streams, chest minecarts or a single hopper feeding a dropper line.
- Lock idle hoppers. A redstone-powered hopper stops transferring, so powering the unused branches of a sorter switches them off.
- Leave the hopper timings alone.
ticks-per.hopper-transferandhopper-checkinspigot.ymllook tempting, but changing them breaks hopper clocks and item sorters server-wide.
The same applies to other block entities. Hundreds of barrels are cheap; hundreds of hoppers, spawners and beacons are not.
Villagers, animals and decoration
- Trading halls are entity-heavy by design, because villagers have expensive AI and pathfinding. A hall of sixty is fine; six hundred is a performance project.
- Animal farms should be culled, not hoarded. Breeding is for food, not a collection.
- Armor stands and item frames look free, and mostly are, but tens of thousands in a build will show up in a profile.
- Boats and minecarts never despawn, so sweep them up.
Modded servers
Modded mobs often have far heavier AI than vanilla ones. If a profile names a mod's entity class, look in that mod's own config for spawn weights and caps rather than reaching for the vanilla settings. Tech mods with item pipes and automated farms are the modded equivalent of a hopper chain, and the fix is the same: fewer, bigger, slower.
Do it in a safe order
- Take a snapshot on the Backups page. Entity clears and cramming changes delete things permanently.
- Measure
tpsandmspt, and take a spark profile while the lag is happening. - Clear dropped items, and sweep up abandoned boats and minecarts.
- Find the worst chunk and deal with what is in it.
- Apply the mob cap and activation range changes, then restart.
- Measure again and compare.
If you work through all of that and are still short of headroom, the world may simply have outgrown its resources, and why is my server lagging? covers what to look at next.
Common questions
How many entities is too many for one server?
There is no fixed number, because a cow and a villager cost wildly different amounts. As a rough guide, if any one chunk holds more than a couple of hundred entities, or entity ticking is a large share of your tick time, you are over the line for your resources.
Will clearing dropped items make my players angry?
It can, if you do it without warning, because the command takes everything loose on the ground including a player's death drops. Announce it in chat first, or use a plugin that gives a countdown before each clear.
Does lowering the mob cap break my mob farms?
Lowering the spawn limits reduces how fast farms produce, because fewer mobs can exist at once. The activation range is the setting that actually breaks designs, since farms relying on mobs moving far from any player will stall, so change that one carefully and check your builds afterwards.
Do entities cause lag when nobody is near them?
Only if their chunks are loaded. Chunks outside your simulation distance are frozen and cost almost nothing, but anything force-loaded or kept alive by a chunk loader plugin is being ticked.
Still stuck? Jump into our Discord at discord.gg/GuavaHost and the team will help you out.
- entities
- mobs
- tps
- lag
- minecraft
Host a Minecraft Java server From $3.99/mo, with instant setup and DDoS protection.
Still need help? Our team is online 24/7 to answer questions.