
Kill All Mobs in Minecraft: Command Syntax and Practical Uses
The /kill @e[type=!player] command is the fastest way to remove every mob from your Minecraft world instantly. It targets all entities except players, making it essential for managing server lag, clearing problem mob farms, or just getting peace and quiet. Below you'll find the exact syntax, useful variations, and practical tips for using this command safely and effectively.
The Basic Kill All Mobs Command
If you want the simplest version, just type /kill @e[type=!player] and press enter. That command kills every zombie, creeper, skeleton, passive mob, and any other entity except you. The @e selector targets every entity in the world. Adding [type=!player] excludes players from the execution (the exclamation mark means "not"). Without that safety check you would kill yourself too, which isn't ideal.
This works in Java Edition 1.13 and newer. In Bedrock Edition the same syntax is valid, though older Bedrock versions may require the experimental toggle for advanced selectors.
Understanding the Selector Syntax
The power of the kill command comes from the target selector. You can add multiple conditions inside the square brackets, separated by commas. Each condition refines which entities are affected.
- type= filters by entity type (zombie, skeleton, item, armor_stand, etc.)
- distance= limits the effect to a radius around the executor (e.g., distance=..10 for within ten blocks)
- nbt= matches specific NBT data (useful for tagged mobs or custom entities)
- tag= matches entities that have been given a custom tag via /tag
Multiple conditions are combined with AND logic. For example, /kill @e[type=zombie,distance=..20] kills only zombies within twenty blocks of you.
To exclude several types you can chain type=! conditions: /kill @e[type=!player,type=!armor_stand,type=!item_frame] kills everything except players, armor stands, and item frames.
Target Selector Variations for Specific Needs
Below are common variations that answer the exact queries you searched for.
- /kill @e[type=!player] - kills all mobs, leaves players untouched (the core command)
- /kill @e[type=mob] - in Java Edition "mob" isn't a valid type; use the specific monster types or invert the player filter as shown above
- /kill @e[type=zombie] - kills only zombies
- /kill @e[type=!player,type=!zombie] - kills everything except players and zombies (useful when you want to preserve a zombie farm)
- /kill @e[type=!player,distance=..30] - kills all entities within thirty blocks, excluding players
- /kill @e[type=!player,type=!armor_stand] - kills mobs but leaves armor stands and players
- /kill @e[type=!player,tag=Protected] - kills everything except players and any entity you have tagged as Protected
If you need to keep livestock while removing hostile mobs, invert the filter: /kill @e[type=!player,type=!cow,type=!pig,type=!sheep,type=!chicken]. So this removes zombies, skeletons, creepers, spiders, and other monsters while preserving your farm animals.
For clearing a specific area without affecting your base, combine distance and type: /kill @e[type=!player,distance=50..200] kills entities between fifty and two hundred blocks away, leaving nearby entities untouched.
When and Why to Use the Command
On multiplayer servers a sudden spike in mob count can tank TPS (ticks per second) and make the game unplayable. Running the kill command clears the excess instantly, restoring smooth gameplay without waiting for a restart.
In single player you might use it after a long AFK session when hostile mobs have piled up around your base. Honestly, it is also handy when testing redstone contraptions or mob farms and you need a clean slate.
Creative mode builders often run the command to keep their workspace free of wandering animals or monsters that interfere with precise placement.
Server administrators use it to reset spawner testing areas, clear stuck mobs from glitched chunks, or prepare a world for a fresh event.
The command executes instantly, with no noticeable delay even when thousands of entities are removed. That immediacy is why it remains the go-to solution for emergency lag spikes.
When NOT to Use This Command
Because the kill command is indiscriminate within its filters, you can accidentally delete entities you want to keep. Armor stands, item frames, paintings, and leash knots are all entities that will be removed unless you explicitly exclude them.
Named pets or custom mobs you have preserved with a name tag or a custom tag will also die if they match the selector. Always double-check your filter before hitting enter.
On a live server with active players, executing a mass kill without warning can ruin someone’s farming session or PvP match. Communicate first, or restrict the command to admin-only via a permissions plugin.
If you're experimenting with a new command syntax, test it in a copy of your world or with a small radius first. One mistyped selector could wipe more than you intended.
Alternatives and Long-Term Solutions
Sometimes you want to stop new mobs from appearing rather than killing what already exists. The gamerule /gamerule doMobSpawning false prevents hostile and passive mobs from spawning. Flip it back to true when you're ready for normal spawns.
For specific mob types you can use spawn-proofing techniques: light up areas with torches or lanterns, use slabs or glass to block spawn points, or rely on the fact that mobs can't spawn on top of certain translucent blocks.
If lag is caused by entity collisions rather than sheer count, consider performance plugins that optimize entity tracking or chunk loading. These mods reduce the server load without removing mobs entirely.
For ongoing farm management, hopper-based collection systems combined with killing chambers let you automate mob removal while keeping the farm running. This approach avoids the need for manual kill commands.
The /kill @e[type=!player] command is a powerful tool, but it works best as a situational fix rather than a daily habit. Use it when you need an instant reset, and rely on preventive measures for long-term world health.
Lead writer at minecraft.how. Long-time Minecraft player running a small SMP server, testing every build, mod, and seed before writing about it.


