---
title: "How to Reduce Entity Lag on a Minecraft Server"
description: "Complete optimization guide to reduce lag caused by entities (mobs, items, frames) on your Minecraft server. Tweak configs, use scheduled tasks, and apply best practices."
category: jeux
subcategory: minecraft-java
icon: tabler:file-text
date: 2026-08-11
author: Winheberg
slug: "reduce-entity-lag-minecraft"
order: 62
image: /statics/images/docs/en/gaming/minecraft-java/reduce-entity-lag-minecraft.webp
tags: [minecraft, plugins, configuration, server, optimization]
keywords: [entity lag minecraft, optimize minecraft server, fix tps drop minecraft, scheduled tasks minecraft, mobstacker plugin, paper yml entities, purpur config mobs, winheberg panel guide]
link_fr: "/docs/minecraft-java/reduire-lag-entites-minecraft"
---

# Guide: How to Optimize Entities & Eliminate Lag on Your Minecraft Server

## Context and Purpose

On a Minecraft server, sudden performance drops (drops in **TPS** or *Ticks Per Second*) are frequently caused by an excessive build-up of **entities**. An entity includes anything that is not a static block: mobs, animals, dropped items, arrows, villagers, item frames, and armor stands.

Every active entity demands continuous CPU cycles from your host node (AI calculations, collision checks, pathfinding, gravity). When their total count exceeds CPU capacity, the server starts experiencing tick lag.

This technical guide walks you through configuring your server files, automating cleans without plugins via your control panel, utilizing specialized tools, and establishing best practices to drastically optimize entity management on your [Winheberg panel](https://panel.winheberg.com).

## Step 1: Switch to an Optimized Server Software

Before tweaking a single line of config, ensure your server is not running default Vanilla software or outdated CraftBukkit/Spigot builds.

> [!IMPORTANT]
> To apply the optimizations detailed in this guide, you must run **[Paper](https://papermc.io/)**, **[Pufferfish](https://pufferfish.host/)**, or **[Purpur](https://purpurmc.org/)**. These server jars feature built-in performance patches and advanced config options tailored specifically for entity management.

You can change your server software with a single click in the **Versions** tab on your [Winheberg panel](https://panel.winheberg.com).

## Step 2: Fine-Tune Configuration Files

Configuration files at the root directory of your server provide the most effective controls to reduce entity load without ruining gameplay mechanics. Access the **File manager** tab on your panel to edit the following files.

### 1. Adjust `spigot.yml`
This file controls activation distances where entities begin calculating AI logic.

```yaml
world-settings:
  default:
    # Reduces the distance (in blocks) at which entities activate
    entity-activation-range:
      animals: 16
      monsters: 24
      raiders: 48
      misc: 8
    # Limits AI tracking calculations (in ticks)
    entity-tracking-range:
      players: 48
      animals: 48
      monsters: 48
      misc: 32
    # Merges dropped items together to reduce physical entity counts
    merge-radius:
      item: 3.5
      exp: 4.0
```

### 2. Adjust `paper-world-defaults.yml`
Introduced in modern Paper releases (replacing the legacy `paper.yml`), this file limits mob clustering.

```yaml
entities:
  behavior:
    # Disables complex entity collisions past a strict threshold
    max-entity-collisions: 2
    # Prevents entities from overloading Nether portals
    portal-search-radius: 8
  spawning:
    # Caps the maximum number of entities per chunk (vital for mob farms)
    max-chunk-entities:
      monsters: 20
      animals: 15
```

### 3. Adjust `purpur.yml` (If using Purpur)
Purpur grants granular control over villager AI processing, which is notoriously heavy on server CPUs.

```yaml
settings:
  # Disables pathfinding ticks if a villager is stationary or trapped
  villager_brain_ticks: 2
  villager_lobotomize:
    enabled: true
    check-interval: 100
```

## Step 3: Automate Cleans WITHOUT Plugins (Scheduled Tasks)

If you prefer not to bloat your server with third-party plugins like *[ClearLagg](https://dev.bukkit.org/projects/clearlagg)*, you can use the native **Schedules** feature built into your [Winheberg panel](https://panel.winheberg.com). This native method is ultra-lightweight and runs commands directly from the console.

### Setting up an automatic dropped item wipe:
1. Open your [Winheberg panel](https://panel.winheberg.com) and navigate to the **Schedules** tab.
2. Click **Create Schedule**.
3. Name the task (e.g., `Entity Wipe`) and enter a Cron expression (e.g., every 2 hours using `0 */2 * * *`). Save it.
4. Click on the created schedule, then select **New Task**.
5. Set the action to **Send command** and enter the following native Vanilla command:
```bash
kill @e[type=item]
```
6. *(Optional)* Add a preceding task with a short delay to broadcast an in-game warning: `say [Notice] Automatic dropped item cleanup in 60 seconds!`.

> [!TIP]
> You can create a second night-time schedule to remove abandoned arrows and projectiles clogging memory:
> ```bash
> kill @e[type=minecraft:arrow]
> ```

## Step 4: Install Entity Management Plugins

For high-population servers where scheduled wipes aren't enough to contain real-time player activities (massive mob farms, overcrowded breeding pens), dedicated tools can be installed via the **Plugins** manager in your panel.

### 1. MobStacker (Mob Stacking)
The **[MobStacker](https://modrinth.com/plugin/mobs-stacker)** plugin (or modern alternatives like **[RoseStacker](https://www.spigotmc.org/resources/rosestacker.82729/)**) is essential for Skyblock and Factions servers. It merges nearby identical entities into a single physical entity displaying a quantity tag (e.g., `Sheep x50`). The server processes only 1 AI thread and 1 collision box instead of 50.

### 2. Chunky (World Pre-generation)
Entity lag is often exacerbated by chunk generation lag. Use **[Chunky](https://www.spigotmc.org/resources/chunky.81534/)** to pre-generate your world map. This frees up CPU power so it can focus entirely on entity ticks instead of rendering terrain live.
```bash
/chunky radius 5000
/chunky start
```

### 3. MobLimiter or FarmLimiter
Plugins like **[MobLimiter](https://modrinth.com/plugin/moblimiter)** or **[FarmLimiter](https://www.spigotmc.org/resources/farmlimiter.1419/)** target intensive livestock farms by enforcing strict entity caps within a block radius (e.g., a hard cap of 20 cows per chunk). Once reached, further breeding or spawning is blocked.

## Step 5: Identify Lag Sources with Spark

Avoid changing settings blind—always profile your server to locate which entities consume resources. The **[Spark](https://spark.lucko.me/)** profiler comes pre-installed or easily added on Paper/Purpur.

1. Execute the following command in-game or through your panel console:
```bash
/spark profiler start --timeout 300
```
2. Let the server run normally under average load for 5 minutes.
3. Spark will output a web link. Open it and navigate the thread tree down to the `Entity Tick` section. It will display the exact entity types (e.g., `Cow`, `Villager`, `ItemFrame`) causing tick delays.

## Troubleshooting

### ❌ Severe TPS Drops (TPS < 10)
The server suffers extreme slowdowns or continuous lag spikes. Check:
*   That your scheduled panel tasks or cleaning plugins are executing as planned.
*   That item merging settings (`merge-radius`) are properly enabled in `spigot.yml`.
*   Whether a player left an automated infinite farm running (run `/spark` to find overloaded chunks).

### ❌ Invisible or "Ghost" Entities
Spark reports heavy entity loads (e.g., thousands of mobs), but the location looks empty to players. Check:
*   Desynchronized entities stuck in corrupted chunk buffers. Teleport to the coordinates and force a local purge using: `/minecraft:kill @e[type=!player,distance=..32]`.
*   Ensure your server jar (Paper/Purpur) is updated to the latest stable build to resolve visual tracking bugs.

### ❌ Wrong Command Used or Important Entities Deleted
An overly broad command deleted unintended entities. Check:
*   If you have a recent world backup available under the **Backups** tab on your Winheberg panel to restore state.

> [!WARNING]
> Running `/kill @e` without entity target arguments deletes **EVERY SINGLE ENTITY** in loaded chunks, including players, trading villagers, item frames, and armor stands. Always use filter tags like `[type=...]` or selective plugins.

## Best Practices

*   **Implement Preventive Scheduled Tasks:** Clearing dropped items every 2 to 3 hours prevents item accumulation from AFK players.
*   **Enforce Mob Stacking:** Require plugins like **[MobStacker](https://modrinth.com/plugin/mobs-stacker)** or **[RoseStacker](https://www.spigotmc.org/resources/rosestacker.82729/)** on mob grinders and spawners to preserve CPU headroom.
*   **Regulate Villager Farms:** Iron golem farm panic mechanics (villagers spooked by zombies) force constant pathfinding recalculations. Ask players to isolate or cap these setups.
*   **Limit Decorative Entities:** Item frames and armor stands require client GPU and server CPU processing. Replace them with standard signs or GUI shop plugins where possible.
*   **Lower `view-distance` and `simulation-distance`:** In `server.properties`, set `simulation-distance` to `4` or `5`. This reduces the physics tick radius around players and prevents distant entities from processing unnecessarily.

## Need Assistance?

If your server TPS remains low after applying these configuration adjustments, your setup may be experiencing memory exhaustion or plugin conflicts.

We are here to help! Submit a ticket via [support Winheberg](https://billing.winheberg.com/login). Our support team will help you analyze logs and get your server running smoothly! 🎮
