25% off on first order withAPEX25

This article is not yet available in your selected language and is being displayed in English.

Minecraft
Posted on Nov 13, 2026

Minecraft Kill Command: Cut Server Lag Without Losing Pets

Your server stutters every time someone walks past the farm, and a quick look shows hundreds of dropped items piled up under the hoppers. The Minecraft kill command can clear that pile in one line, but only if you pick the right selector. C...
Minecraft Kill Command: Cut Server Lag Without Losing Pets

Table of Contents

Share on
Read Progress

Your server stutters every time someone walks past the farm, and a quick look shows hundreds of dropped items piled up under the hoppers. The Minecraft kill command can clear that pile in one line, but only if you pick the right selector. Choose the wrong one and the same line deletes your villagers, your armor stands, and every wolf your players spent an hour taming.

The goal is the smallest command that fixes the problem. This guide builds that ladder from the safest clear upward, and shows what each step removes.
 

The Quick Answer: Clear Dropped Items Safely

To remove every dropped item in the loaded chunks, run this:

kill @e[type=item]

The type=item filter matches item entities only, meaning stacks lying on the ground. Mobs, players, item frames, and armor stands stay exactly where they are. The command works in-game (with a leading slash) and from the Apex console (without one).

Every dropped stack is a separate entity the server has to track, and thousands of items in one chunk can drag the whole server down. Clear them first. If the server is still sluggish afterward, move one rung up the ladder below.
 

Why /kill @e Is the Command to Avoid

Plain kill @e removes every entity in the loaded chunks. That includes you. Among the things it can take out:

  • Players, including everyone online
  • Pets such as wolves, cats, and parrots
  • Villagers and wandering traders
  • Item frames, armor stands, and paintings
  • Boats and minecarts

 
The Minecraft Wiki notes that non-mob entities disappear when targeted. Mobs and players drop their loot when killed, which means a mass mob kill creates a fresh pile of items to clean up.

There is no undo. If an item frame wall or a villager trading hall goes, only a backup brings it back.

Two other forms are worth knowing. A bare kill with no target kills whoever ran it, so typing it in-game kills you. And kill @e[type=!player] spares players, but it still wipes everything else on the list above. Skipping players is not the same as being safe.
 

Safe Selectors for Common Cleanups

Every command here uses a type= filter, so it only touches the one kind of entity you name. The @e part means “all entities”, and the square brackets narrow it down.

Job Command What it removes What it leaves
Clear dropped items kill @e[type=item] Item entities in loaded chunks Mobs, players, item frames, armor stands
Clear experience orbs kill @e[type=experience_orb] Loose XP orbs Everything else
Remove one mob type kill @e[type=zombie] Every zombie in loaded chunks Other mobs, pets, players
Clear items near you kill @e[type=item,distance=..32] Items within 32 blocks of you Items farther away
Remove a mob type near you kill @e[type=creeper,distance=..40] Creepers within 40 blocks of you Creepers farther away

 
Entity IDs are lowercase, with words joined by an _ character, such as experience_orb. You can add the minecraft: prefix if you like; type=minecraft:zombie works the same way.

The distance=..32 part means “32 blocks or less”, measured from where the command is run. In-game, that is your position. Stand in the middle of the problem area and the clear stays local. That makes in-game use the better route for area clears; from the console, stick to commands without a distance.

Plenty of players search for a kill all mobs command in Minecraft. Java has no selector argument for “every hostile mob”, so you remove them one type at a time. Run the command for the types you actually see: zombie, skeleton, creeper, spider. This is slower to type than a catch-all, and that is the point. You decide what goes.

One more thing about mob kills. Each killed mob drops its loot, so follow a zombie clear with kill @e[type=item] to sweep the drops.
 

Protecting Pets and Named Mobs

Minecraft has no “tamed” filter for selectors. You protect pets by choosing what to target, not by excluding a pet flag. There are three safe habits.

First, target by type and leave the pet types alone. If you only kill zombies, no wolf is ever in the selector. This is the safest method, and the table above uses it throughout.

Second, exclude by type when you must use a broader selector. Several type=! arguments can sit in one selector, so a command like kill @e[type=!player,type=!wolf,type=!cat,type=!parrot,type=!horse,type=!donkey,type=!mule,type=!llama] spares those eight kinds. Notice the cost: it spares every wolf, tamed or wild, and it still removes villagers, item frames, and boats. The list grows fast. Use it only when you have a specific reason.

Third, mark what you want to keep. Stand next to your pets in-game and run tag @e[type=wolf,distance=..5] add keep. Any entity carrying the keep tag can then be skipped with tag=!keep. Remove the tag later with tag @e[tag=keep] remove keep.

For example, this clears every wolf except the ones you tagged:

kill @e[type=wolf,tag=!keep]

Named mobs work the same way. A mob renamed with a name tag can be skipped with name=!Rex, so kill @e[type=wolf,name=!Rex] removes wolves except the one called Rex.
 

Run /kill From Your Apex Server Console

You do not need to be in the game to clear entities. The console is handy when the lag is bad enough that joining is painful.

  1. Head towards your Apex server panel and start the server if it is not online.
  2. Press the “Console” button near the top left corner.
  3. Type the command in the text box and press Enter.

 
Leave off the leading slash in the console. Type kill @e[type=item], not /kill @e[type=item].

Always give the console a target. Without a player standing behind the command, a bare kill has nothing to act on and fails. Selectors that include distance= are better run in-game, where the measuring point is you.

If you want to run commands in-game instead, your account needs operator status. The Apex guide on how to op yourself covers this, and it is done from the console too. Operators at permission level 2 and above can use /kill.

Before any large clear, take a backup. The Apex guide on backing up your Minecraft server walks through the panel’s backup tool. The panel keeps only one backup at a time, so a fresh backup replaces the older one. If a clear goes wrong, the guide to restoring your backup shows how to put the world back.
 

Stop the Build-Up Coming Back

Clearing by hand fixes today’s pile. It does not stop tomorrow’s. A hopper line that overflows or a mob farm that never empties will refill the server with entities within hours.

Start with the cause. Apex’s guide on why your server is lagging covers other common causes, mainly plugins and running out of RAM. Use it to tell whether entities are even your problem. Run the item clear once and check whether the lag eases. If it does, entities were the cause.

For a permanent fix, let a plugin clear entities automatically. The ClearLagg plugin guide shows how to install it from the panel’s Modbox or by hand. Its config lets you choose which entities get removed and broadcast a warning first. Plugins need a Spigot or Paper server jar, so check the Game File option in the panel before installing.
 

Minecraft Kill Command FAQ

 

Can I Undo the Kill Command?

No. Killed entities are gone, and the game has no undo for commands. Restore a backup taken before the clear. This is why the backup comes first.
 

Will the Kill Command Kill Players?

Only if the selector matches them. @e and @a include players, so avoid both unless you mean it. A selector with type=item or type=zombie never touches a player.
 

How Do I Kill All Mobs Without Killing Pets?

Remove one hostile type at a time, such as kill @e[type=zombie], and repeat for each type you want gone. Tag or name the pets you want to protect, then add tag=!keep or name=! plus the pet’s name to the selector.