What is entity lag?
Entity lag is a drop in server TPS that happens when the loaded chunks contain so many mobs, animals, items or other entities that the server can't process them all within the 50 ms it has for each tick. Every entity calculates movement and collisions each tick, and mobs also run AI and pathfinding.
In Minecraft, an entity is anything that isn't a block and can move or lie around in the world:
| Entity type | Examples | Usual source of the problem |
|---|---|---|
| Mobs and animals | cows, chickens, zombies, villagers | breeding farms, villager trading halls, spawners |
| Dropped items | mined blocks, mob drops | farms without hoppers, full chests, TNT explosions |
| Experience orbs | XP from mobs and furnaces | XP farms nobody collects from |
| Projectiles | arrows, snowballs, ender pearls | skeleton farms, arrows stuck in the ground |
| Other | minecarts, boats, armor stands, item frames | minecart systems, armor stand decorations |
Typical signs: TPS drops only in one area (near someone's base), mobs "teleport" around, and the lag grows day by day because a farm keeps running and nobody cleans up. Client-side lag (low FPS near a farm) is a different issue – the server can still be running at a full 20 TPS.
How do I check whether entities are causing the lag?
Run the spark profiler while the lag is happening and check whether entity ticking dominates the report, then use paper entity list to find the entity type and the location with the most of them. Don't change settings blindly – measure first.
- TPS: in the "Console" tab, type
spark tps(no slash). Below 20 TPS with a median tick over 50 ms means the server can't keep up. - Profiler:
spark profiler start --timeout 300, wait 5 minutes and open the link from the console. If most of the time in "Server thread" goes to entries containingEntityor mob AI, entities are the culprit. How to read the report is covered in spark profiler for Minecraft. - Entity list (Paper, Purpur):
paper entity listshows how many entities of each type are ticking in the world. With a type filter, e.g.paper entity list minecraft:item, you'll see which chunks contain the most of them. - Counting on any server type:
execute if entity @e[type=minecraft:item]returns how many entities of that type are in loaded chunks, e.g. "Test passed, count: 1843". - Mob caps:
paper mobcapsshows whether the spawn limits are full.
| Result | What it means |
|---|---|
hundreds of item entities in a few chunks |
a farm nobody collects from, or full chests |
| hundreds of one animal in a single chunk | a breeding farm with no limit |
dozens of villager entities in one spot |
a trading hall or an iron farm |
thousands of experience_orb |
an XP farm nobody collects from |
How does entity-activation-range reduce mob lag?
entity-activation-range in spigot.yml sets how far from a player (in blocks) entities tick normally – beyond that, Paper and Spigot only tick them occasionally, which takes a lot of load off the CPU. Lower values mean less work for the server, but mobs far from players react more slowly.
Defaults (section world-settings.default.entity-activation-range) and our suggestions for a busy server:
| Key | Default | Suggested | Applies to |
|---|---|---|---|
animals |
32 |
16–24 |
animals |
monsters |
32 |
24 |
hostile mobs |
raiders |
64 |
48 |
raid mobs, e.g. pillagers |
misc |
16 |
8–12 |
items, projectiles and other entities |
water |
16 |
12 |
water mobs |
villagers |
32 |
16–24 |
villagers |
flying-monsters |
32 |
32–48 |
flying mobs, e.g. ghasts |
tick-inactive-villagers |
true |
false for big trading halls |
whether villagers outside the range keep ticking |
world-settings:
default:
entity-activation-range:
animals: 24
monsters: 24
raiders: 48
misc: 12
water: 12
villagers: 24
flying-monsters: 48
tick-inactive-villagers: false
Only change the keys from the table – leave the other lines in this section (wake-up-inactive and the rest) as they are. Things to watch out for:
- Entities outside the range don't freeze completely. The server wakes them up briefly from time to time (the
wake-up-inactivesection), so the world keeps going, just more slowly. - Farms far from the player slow down. A farm where mobs have to walk or fall a long way may produce less while the player stands outside the activation range.
tick-inactive-villagers: falsestops villagers far from players from working – iron farms and villager crop farms outside player range will stop.- Don't go too low on
monsters. With very small values, hostile mobs only "wake up" close to the player and combat starts to feel odd.
This setting doesn't change what players can see – that's entity-tracking-range, covered in Minecraft entity broadcast range.
How do I merge dropped items and XP (merge-radius)?
merge-radius in spigot.yml sets the distance (in blocks) at which nearby dropped items of the same kind, and experience orbs, combine into one entity. Instead of 64 separate items, the server only has to process one stack.
| Key | Default (Paper) | Suggested |
|---|---|---|
merge-radius.item |
0.5 |
2.5–3.5 |
merge-radius.exp |
-1 (disabled) |
3–4 |
world-settings:
default:
merge-radius:
item: 3.0
exp: 3.0
With a large radius, items can "jump" through a thin wall or into a neighbouring hopper – on farms with precise item sorting, check that everything still ends up where it should. Don't go above a few blocks.
How do I make dropped items despawn faster?
A dropped item despawns after 6000 ticks (5 minutes) – that's item-despawn-rate in spigot.yml; Paper also lets you shorten the time for specific items only. Shortening it for every item is risky, because players get less time to recover their gear after dying.
A better option is alt-item-despawn-rate in config/paper-world-defaults.yml – a shorter time just for "junk" items:
entities:
spawning:
alt-item-despawn-rate:
enabled: true
items:
cobblestone: 300
netherrack: 300
cobbled_deepslate: 300
rotten_flesh: 1200
Values are in ticks: 300 is 15 seconds, 1200 is one minute. In the same file, entities.spawning.non-player-arrow-despawn-rate shortens the lifetime of arrows shot by skeletons and dispensers.
How do I limit entities per chunk (Paper)?
Paper's config/paper-world-defaults.yml has chunks.entity-per-chunk-save-limit, which caps how many entities of a given type are saved in one chunk – anything over the limit is removed when the chunk is saved. There are no limits by default (-1). It's a good safety net against thousands of XP orbs and arrows.
chunks:
entity-per-chunk-save-limit:
experience_orb: 16
arrow: 16
snowball: 8
ender_pearl: 8
fireball: 8
small_fireball: 8
The numbers above are our suggestion, not official values. Don't add animals or villagers here – the limit works by deleting the excess, so players would lose part of their livestock without warning.
Other options that help when there are lots of entities:
| Option | Default | What it does |
|---|---|---|
collisions.max-entity-collisions |
8 |
After how many collisions the server stops processing more – a lower value helps with tightly packed mobs |
entities.armor-stands.tick |
true |
false turns off armor stand physics – useful with lots of decorations, but breaks armor stand contraptions |
entities.behavior.pillager-patrols.disable |
false |
true disables pillager patrols |
nerf-spawner-mobs (in spigot.yml) |
false |
true removes most AI from spawner mobs – less lag, but the mobs don't move on their own, so test your farm |
How do I keep mob and animal farms in check?
The worst lag comes from farms without limits: pens with hundreds of animals, halls with dozens of villagers and farms where items pile up on the ground. Server settings only soften the effects – clear rules for players fix it for good.
- Set an animal limit per pen, e.g. 20–30 of one species, and add it to your server rules. Plugins that limit entities per chunk, available in the "Addons" tab, can enforce it.
- Limit mob cramming with a game rule.
gamerule max_entity_crammingdefaults to24: when more mobs stand in one spot, they start taking suffocation damage. A lower value (e.g.8–12) stops overcrowded pens, but also kills mobs in farms that pack them in on purpose. Up to 1.21.10 the rule is calledmaxEntityCramming. More in Minecraft game rules. - Hoppers under every farm. Items should go straight into chests. Full chest = items on the ground = lag.
- XP farms – collect the XP regularly or cap the orbs with the
experience_orblimit from the previous section. - Trading halls: a villager locked in a cell still runs its AI. Fewer villagers plus
tick-inactive-villagers: falsemakes the biggest difference. - Natural spawn limits (
spawn-limits,mob-spawn-range) reduce wild mobs, but don't affect breeding or spawners – see Minecraft mob spawn range and rate.
How do I remove mobs and items with /kill?
The kill command with an @e[type=…] selector instantly removes every entity of the chosen type – for example, kill @e[type=minecraft:item] clears all dropped items in loaded chunks. In the panel console, type it without a slash; in game, use the slash and operator permissions.
Safe examples:
| Command | What it removes |
|---|---|
kill @e[type=minecraft:item] |
all dropped items |
kill @e[type=minecraft:experience_orb] |
all experience orbs |
kill @e[type=minecraft:arrow] |
arrows, including ones stuck in blocks |
execute at Steve run kill @e[type=minecraft:item,distance=..64] |
items within 64 blocks of the player Steve |
execute at Steve run kill @e[type=minecraft:cow,distance=..32,limit=50,sort=random] |
50 random cows near the player Steve |
Never run plain kill @e. It removes everything: players, tamed pets, villagers, item frames, armor stands, minecarts and boats. It can't be undone – only a backup brings them back. Even kill @e[type=!minecraft:player] removes item frames, armor stands and named animals.
kill only works in loaded chunks – entities in unloaded areas stay. Let players know before you clear their farms.
Should I use ClearLag or similar plugins?
Plugins like ClearLag treat the symptom, not the cause: they delete items and mobs every few minutes, but the farm producing them keeps running. Reach for them only after changing the settings in this guide, and configure them carefully.
Things to watch out for:
- Death drops. A player coming back for their gear may find nothing. Use a longer clear interval, chat warnings, and exclude valuable items.
- Mob removal. Turn off clearing of animals, villagers, and named or tamed mobs – otherwise players lose their livestock and pets.
- "Lag check" commands in these plugins aren't profilers – only spark shows the real cause.
- Version compatibility. Many plugins of this kind are no longer maintained. Check that the file matches your server version before installing.
- Mob stacking (e.g. StackMob) cuts the entity count dramatically, but changes gameplay: one "stack" instead of 30 cows, and different behaviour when killing and breeding.
On Paper and Purpur, install plugins from "Addons" → "Available to install": search for the name, pick the file marked "Compatible with your server" and click "Install".
How do I change these settings on a Spot.gg server?
On a Spot.gg Minecraft server running Paper or Purpur, open "Files", click "Edit" next to spigot.yml or config/paper-world-defaults.yml, change the values, click "Save" and restart the server.
- In "Backup", click "Create backup" – just in case something goes wrong in the file.
- Go to "Files".
spigot.ymlis in the server's main folder andpaper-world-defaults.ymlis in theconfigfolder. The files appear after the server has started once. - Click "Edit" next to the file, change the values and click "Save". Indentation in
.ymlfiles uses spaces – don't use tabs. - Restart the server with the restart button in the panel's top bar. These files are only read at startup.
- Check the result in "Console":
spark tpsandpaper entity list.
The simplest change needs no file editing: "Configuration" → "Most popular" → "Performance" → the "Simulation distance" slider, then "Save changes" and "Restart now". A smaller simulation distance means fewer chunks where entities tick at all – details in Minecraft simulation distance.
Servers on Vanilla, Fabric, Forge or NeoForge have no spigot.yml or Paper config. Your options there are the simulation distance, the max_entity_cramming game rule, kill with selectors, and mods – e.g. Clumps, which merges XP orbs. If the server doesn't use mods, you can switch it to Paper in "Information" → "Modify" → "Change engine" – the world stays. See how to install Paper.
Paid Minecraft servers on Spot.gg start from $3.90 per month.
FAQ
How do I check how many mobs are on my server?
On Paper and Purpur, run paper entity list in the console to see the count of each entity type. On any server type, execute if entity @e[type=minecraft:cow] returns how many entities of that type are in loaded chunks.
How do I clear all dropped items on a server?
Run kill @e[type=minecraft:item] in the console. It only removes items in loaded chunks, including players' death drops – warn players before clearing.
Does entity-activation-range break farms?
It can slow down farms where mobs walk or fall a long way from the player, and with tick-inactive-villagers: false it stops villagers outside the range. Farms where the player stands AFK within the activation range work normally.
Will ClearLag fix server lag?
Temporarily – it removes dropped items and some mobs. If a farm is causing the lag, it comes back within minutes. Find the cause with spark first and tune spigot.yml and the Paper config; treat the plugin as an extra.
Will more RAM help with mob lag?
Usually not. Entity lag is CPU load on the server's main thread, not a lack of memory. More RAM helps when spark health shows memory constantly full. Other causes of lag are covered in how to fix Minecraft server lag.