
The short answer is /kill @e[type=!player], which clears every mob, dropped item, and XP orb while leaving players alone. The selectors further down narrow it so you keep villagers, tamed pets, armor stands, and item frames.
Your world has a few thousand dropped items sitting in loaded chunks, a couple hundred zombies, and a villager breeder that somebody left running over the weekend. You type /kill @e and everything dies. Including you. Including every player online.
The @e selector targets every entity, and players are entities. Nothing about /kill is careful on your behalf. The whole job is writing a selector that hits exactly what you want and nothing else.
Kill Everything Except Players
/kill @e[type=!player]
The ! negates the type filter, so this kills every entity that is not a player. Items, mobs, XP orbs, armor stands, minecarts, all of it. Players stay alive.
That is the command most people come looking for, and it is also the one that gets admins in trouble. Read the next section before you run it on a world you care about.
What type=!player Actually Deletes
Everything on this list goes:
- Tamed and named pets
- Villagers, including cured ones with good trades
- Armor stands holding gear displays
- Item frames with maps and trophies
- Boats and minecarts, along with whatever is riding in them
- Every dropped item on the ground, including the pile somebody just died on
There is no undo. Entities removed by /kill are gone until you restore a backup. On a live server, run the radius limited version first, or take a backup, or both.
Keep Villagers, Pets and Displays Alive
Stack as many type=! filters as you need. Each one adds another exception:
/kill @e[type=!player,type=!villager,type=!wolf,type=!cat,type=!armor_stand,type=!item_frame]
That clears the junk near spawn without deleting the trading hall, the dogs, or the map wall behind the shop.
Kill All Dropped Items on the Ground
/kill @e[type=item]
Ground items are the usual reason an entity count runs away. One blown up storage room or an item farm with a full output chest leaves thousands of them ticking. XP orbs pile up the same way and have their own type:
/kill @e[type=experience_orb]
To limit it to what is around you instead of the whole loaded world:
/kill @e[type=item,distance=..50]
Worth knowing: selectors only see entities in loaded chunks. Items sitting in a corner of the map nobody has visited since the server restarted will not be touched until that area loads again.
Kill All Villagers
/kill @e[type=villager]
Villager breeders get away from people, and a few hundred villagers in one chunk will hurt tick times long before anyone notices the trades. Kill them near you rather than everywhere at once:
/kill @e[type=villager,distance=..30]
Three separate types trip people up here. wandering_trader is not a villager, zombie_villager is not a villager, and iron_golem is not a villager either, so type=villager leaves all three standing. If a breeder produced golems too, you need a second command for them.
Kill All Mobs Without Touching Players or Items
There is no vanilla tag meaning "every hostile mob". Guides that hand you /kill @e[type=#minecraft:hostile] are quoting a datapack tag, not something that ships with the game. Vanilla does have entity type tags, and these three are useful:
/kill @e[type=#minecraft:zombies]
/kill @e[type=#minecraft:skeletons]
/kill @e[type=#minecraft:raiders]
For everything else, run one command per type. Boring, but you always know what died:
/kill @e[type=creeper]
/kill @e[type=spider]
/kill @e[type=enderman]
If you want the mobs gone but the items and builds intact, go the other way and exclude what stays:
/kill @e[type=!player,type=!item,type=!experience_orb,type=!armor_stand,type=!item_frame,type=!villager,type=!minecart]
Mobs respawning straight back into the same chunks is a separate problem. That one is fixed with mob caps and activation ranges, not with a bigger kill command.
Limit the Kill to an Area
Add coordinates and a distance:
/kill @e[type=!player,x=100,y=64,z=200,distance=..50]
That kills non player entities within 50 blocks of X=100, Y=64, Z=200. distance=..50 means "from 0 to 50 blocks away", and distance=10..50 gives you a hollow shell, useful when you want to clear the area around a farm without touching the farm itself.
Automatic Item Cleanup on a Timer
The command block version:
- Place a repeating command block and set it to Always Active
- Run
/kill @e[type=item], or a filtered version that spares what you care about - Put a warning message on a timer ahead of it so players are not surprised
Two things vanilla will not do for you. It cannot count entities and act on a threshold without a scoreboard, so "clear items only when there are more than 500" is not a one line selector. It also cannot filter items by age, because NBT matching looks for an exact value rather than a range, which is why nbt={Age:5000s} does not behave the way old guides promise.
Both of those are why public servers use a plugin instead. ClearLagg announces "Ground items will be cleared in 60 seconds", removes items past a set lifetime, and lets you whitelist things like netherite and shulker boxes. It is on SpigotMC at spigotmc.org/resources/clearlagg.68271/.
Gamerules That Slow the Buildup
Sometimes the fix is fewer entities appearing rather than a bigger broom:
/gamerule doMobLoot false
/gamerule doTileDrops false
/gamerule doEntityDrops false
doMobLoot stops mobs dropping loot, doTileDrops stops broken blocks dropping items, and doEntityDrops covers non mob entities like minecarts and item frames. Sensible on a minigame or event map. On a survival server it takes the game away from your players, so treat it as a last resort during an incident rather than a permanent setting.
Entity Types Reference
| Entity Type | What It Is |
|---|---|
player | Real players |
item | Dropped items on the ground |
experience_orb | XP globes floating around |
zombie | Zombies (all variants) |
skeleton | Skeletons |
creeper | Creepers |
spider | Spiders |
armor_stand | Armor stands |
item_frame | Item frames |
minecart | All minecart types |
villager | Villagers |
wandering_trader | Wandering traders |
zombie_villager | Zombie villagers |
iron_golem | Iron golems |
wolf | Dogs and wolves |
cat | Cats |
arrow | Shot arrows, flying or stuck in blocks |
Ignore Any Guide Still Using r=0
Old tutorials suggest @e[r=0] to target entities at the command block. The r parameter was replaced by distance in Java Edition 1.13, so anything written with r= is from before that and probably wrong in other ways too. Use distance=0 or distance=..5.
Command Block or Plugin
For a one off cleanup, or a small server where you are the only one running commands, command blocks are fine. For a public server with players who will lose loot when the sweep fires, a plugin is the better answer purely because of the countdown warning. Entity cleanup is only one part of tick health anyway, so if the server is still stuttering after the world is clear, work through the wider lag checklist and check what your TPS is actually telling you.
Space-Node plans give you full command block support and plugin installs straight from the panel, so either route is open. Have a look at the Minecraft plans.
Quick Answers
| Question | Command or answer |
|---|---|
| How do I kill all items on the ground? | /kill @e[type=item]. Add distance=..50 to keep it near you. |
| Kill all items command | Same selector, /kill @e[type=item]. XP orbs need /kill @e[type=experience_orb] separately. |
| How do I kill all villagers? | /kill @e[type=villager]. Wandering traders, zombie villagers, and iron golems survive it. |
| Command to kill all villagers in one area | /kill @e[type=villager,distance=..30] from where you are standing. |
| How do I kill all mobs in Minecraft? | Run type specific kills, use the #minecraft:zombies, #minecraft:skeletons, and #minecraft:raiders tags, or exclude players, items, and displays with stacked type=! filters. |
| Kill everything except players | /kill @e[type=!player], which also removes pets, villagers, armor stands, item frames, boats, and minecarts. |
Does /kill @e kill players? | Yes, every player online including you. Always filter with type=!player or a specific type. |
| Can I undo a mass kill command? | No. Restore from a backup, or accept the loss. |
| Why did my villagers disappear? | Somebody ran /kill @e or /kill @e[type=!player]. Use type specific selectors instead of blanket ones. |
| How do servers auto clear items? | A repeating command block on a timer, or a plugin like ClearLagg that warns players first and spares valuable drops. |
| Minecraft kill all block entities | Chests, hoppers, furnaces, and signs are blocks with data, not killable entities, so /kill does nothing to them. Use /fill or WorldEdit. |
Never run a broad /kill @e on a production world without a backup. If the goal is lag rather than a clean map, start with dropped items, XP orbs, and arrows. That covers most of the entity count on a normal server, and none of it makes a player angry.