The /kill Command: How to Remove Lag, Kill All Entities and Armor Stands

The /kill command helps quickly tidy up the world: remove unnecessary items that interfere with gameplay, or get rid of a crowd of mobs. The main thing is to know how to properly write the conditions so you don't accidentally delete all your progress.
Article Navigation
How the kill Command Works
The syntax looks like this: /kill <selector>
If you simply type /kill in chat, your character will die. To make the command work on someone else, selectors are used:
- @e - absolutely everything: mobs, players, items on the ground, boats and even armor stands.
- @a - all players on the server.
- @p - only the player who is closest to the command input location.
- @s - yourself.
How to Kill All Mobs Without Touching Players
The most common mistake is to enter /kill @e. This will kill everyone, including you. To prevent the command from touching people, you need to add a special condition type=!player. The exclamation mark here works as a "not" particle.
Command:
/kill @e[type=!player]
After this, mobs and items will disappear, and players will remain in place.
How to Remove Lag and Clean the Map of Clutter
Usually the game starts to lag when there are too many blocks and resources lying on the ground (for example, after a TNT explosion). To remove only this clutter and not touch living creatures, use this option.
Remove only items on the floor:
/kill @e[type=item]
Remove only one type of mob (for example, zombies):
/kill @e[type=zombie]
How to Kill Mobs Only Near You
Sometimes you need to clean not the entire world, but only a specific room or cave. For this, the distance parameter is used.
Destroy everyone within a 10 block radius:
/kill @e[distance=..10]
It's important to put two dots .. before the number. This means "everything closer than 10 blocks". If you just write 10, the command will try to find someone standing exactly on that line.
How to Kill an Armor Stand
Armor stands are technically considered entities (like mobs), not blocks. If too many have accumulated, they can be removed in bulk.
Command for all stands in the world:
/kill @e[type=armor_stand]
If you need to remove a stand that is standing right in front of you, add a radius: /kill @e[type=armor_stand,distance=..3].
How Not to Delete Too Much
When you clean the world through @e, item frames, paintings and beloved pets get caught in the crossfire. To save them, exceptions can be listed separated by commas.
Example: world cleanup in which players, dogs and horses will survive:
/kill @e[type=!player,type=!wolf,type=!horse]
What else is worth adding to exceptions:
type=!villager- so the village doesn't die out.type=!item_frame- so frames don't fall off the walls.type=!painting- so paintings don't disappear.
Why the Command Might Not Work
- No permissions: If you're playing on a server, you must have "admin" (op). In single player, cheats must be enabled in the world settings.
- Far distance: The command doesn't see those who are in unloaded chunks (very far from you).
Published by: TNT