Minecraft Kill Command: Remove Entities Except Players

Published on | Updated

/kill @e[type=!player] removes every entity except players, including pets and villagers. Safer Java and Bedrock versions, and the 26.x gamerule names.

minecraft kill entities except players command guide

The short answer is /kill @e[type=!player], which clears every mob, dropped item, and XP orb while leaving players alone. It also deletes tamed pets, villagers, armor stands, item frames, boats and minecarts, so the safer version for most worlds is /kill @e[type=!player,type=!villager,type=!wolf,type=!cat,type=!armor_stand,type=!item_frame]. The selectors further down narrow it further, and a section near the end covers the Bedrock versions, which differ.

We checked every command, entity ID and gamerule name against the Minecraft Wiki for Java Edition 26.3 and the current Bedrock Edition on 29 November 2026.

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 (our command blocks guide shows how to get one and switch them on):

  1. Place a repeating command block and set it to Always Active
  2. Run /kill @e[type=item], or a filtered version that spares what you care about
  3. 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. Java Edition renamed its gamerules in 1.21.11, so on 26.x they are:

/gamerule mob_drops false
/gamerule block_drops false
/gamerule entity_drops false

On Java before 1.21.11 and on Bedrock the old names still apply: doMobLoot, doTileDrops and doEntityDrops on old Java versions, and domobloot, dotiledrops and doentitydrops on Bedrock. A guide that only gives the old Java names was written before the rename.

mob_drops stops mobs dropping loot, block_drops stops broken blocks dropping items, and entity_drops 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 TypeWhat It Is
playerReal players
itemDropped items on the ground
experience_orbXP globes floating around
zombieZombies (all variants)
skeletonSkeletons
creeperCreepers
spiderSpiders
armor_standArmor stands
item_frameItem frames
minecartAll minecart types
villagerVillagers
wandering_traderWandering traders
zombie_villagerZombie villagers
iron_golemIron golems
wolfDogs and wolves
catCats
arrowShot arrows, flying or stuck in blocks

Java vs Bedrock Kill Commands

Bedrock uses different selector arguments and a few different entity IDs, so a Java command pasted into Bedrock can fail or miss things.

What you wantJava Edition 26.3Bedrock Edition
Everything except players/kill @e[type=!player]/kill @e[type=!player]
Dropped items/kill @e[type=item]/kill @e[type=item]
XP orbs/kill @e[type=experience_orb]/kill @e[type=xp_orb]
Items within 50 blocks/kill @e[type=item,distance=..50]/kill @e[type=item,r=50]
All villagers/kill @e[type=villager]/kill @e[family=villager]
Hostile mobsOne command per type, or the tags #minecraft:zombies, #minecraft:skeletons, #minecraft:raiders (the first two also hit zombie and skeleton horses)/kill @e[family=monster]
Animals and other mobs, but not monstersOne command per type/kill @e[family=mob,family=!monster]

Three differences cause most of the trouble:

  • Radius: Java uses distance=..50. Bedrock still uses r for the maximum range and rm for the minimum, so r=50 is correct there.
  • Villagers: in Bedrock the current villager is villager_v2, and type=villager is the old villager. family=villager catches both.
  • Item frames: in Bedrock an item frame is a block with a block entity, not an entity, so /kill cannot touch it. That also means you do not need to exclude it.

Bedrock's family argument has no Java equivalent. It filters on the entity's type family, which is how family=monster reaches every hostile mob in one go.

Ignore Any Java Guide Still Using r=0

Old Java tutorials suggest @e[r=0] to target entities at the command block. In Java Edition the r parameter was replaced by distance in 1.13, so a Java guide written with r= is from before that and probably wrong in other ways too. Use distance=0 or distance=..5. On Bedrock, r is still the current syntax.


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

QuestionCommand 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 commandSame 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 entitiesChests, hoppers, furnaces, and signs are blocks with data, not killable entities, so /kill does nothing to them. Use /fill or WorldEdit.
Kill all hostile mobs in Bedrock/kill @e[family=monster]. Java has no single selector for this.
Gamerule to stop mob drops on 26.x/gamerule mob_drops false in Java, /gamerule domobloot false in Bedrock.

For the other commands an admin needs, see our Minecraft server commands cheat sheet.

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.