Minecraft · Wiki · Command

/kill

Kills entities. With no target it kills you.

TypeCommand

Data checked Oct 21, 2026

The /kill command instantly removes entities from a Minecraft world: players, mobs, dropped items, minecarts, armor stands and more. It is used to get unstuck, clear lag from too many items, wipe out mobs after a test, reset minigames and clean up after farms. Used carelessly, it can also delete your pets, villagers and decorations, so it is worth knowing exactly how selectors work. This command reference covers the syntax in Java and Bedrock, safe target selectors, examples, permissions and common mistakes.

Syntax

Edition Syntax
Java /kill [targets]
Bedrock /kill [target]

If you leave out the target, the command kills you. In Java this is the same as /kill @s. Killing yourself is a quick way to respawn at your bed or world spawn when you are stuck, lost or trapped, though you drop your items unless keepInventory is on.

Target selectors

Selector Selects
@s Yourself
@p The nearest player
@a All players
@r A random player
@e All entities: mobs, items, minecarts, armor stands, paintings, item frames and more

You can filter selectors with arguments in square brackets, such as type, distance, name and tag in Java, or type, r (radius) and family in Bedrock. Filters are what make /kill safe to use.

Safe and useful examples

Command What it removes
/kill Yourself
/kill @e[type=item] All dropped items, a common lag fix
/kill @e[type=zombie] Every zombie in loaded chunks
/kill @e[type=!player] Every entity that is not a player (use with care)
/kill @e[type=creeper,distance=..20] Java: creepers within 20 blocks
/kill @e[type=creeper,r=20] Bedrock: creepers within 20 blocks
/kill @e[family=monster] Bedrock: all hostile mobs
/kill @e[type=experience_orb] Java: all XP orbs lying around
/kill @e[type=arrow] Arrows stuck in blocks and the ground

Why /kill @e is dangerous

Typing /kill @e with no filters kills every entity in loaded chunks, including you and every other player, your tamed wolves, cats and horses, villagers in your trading hall, iron golems, items on the ground, minecarts with chests and their contents, armor stands, paintings and item frames with their items. On a server, it can destroy hours of work for everyone at once. Always add a type filter, a distance or radius filter, or exclude players and named mobs. A safer pattern for clearing hostile mobs in Java is to target specific types, such as zombies, skeletons, creepers and spiders, one at a time.

Protecting named mobs

In Java, you can skip mobs with names, for example by targeting only entities without a custom name using the name selector in combination with a type. The simplest protection is to always target by type and distance. In Bedrock, the family filter separates monsters from animals and villagers, which makes /kill @e[family=monster] a relatively safe way to clear hostiles.

Using /kill to fix lag

Big farms, explosions and broken storage systems can leave thousands of items and XP orbs on the ground, which slows the game. /kill @e[type=item] clears them instantly. Server staff often schedule this as part of lag-clearing plugins, but in vanilla you can run it from a command block on a timer. Remember that it deletes items players dropped by accident too, so warn players before running it on a server.

/kill vs normal damage

/kill deals a special kind of damage that ignores armor, Resistance and most protection. In Java it is not stopped by a totem of undying, and it works in Creative mode. Bosses such as the Ender Dragon and the Wither can be killed with it, which is useful in testing worlds.

Getting unstuck

If you get trapped in blocks after a teleport, fall into a hole you cannot climb out of, or lose your way far from home, /kill with no target respawns you at your bed, respawn anchor or world spawn. Set a bed first so you return somewhere useful, and drop or store your items in an ender chest beforehand if keepInventory is off.

Permissions

/kill requires cheats in single player or operator permission level 2 or higher on Java servers. In Bedrock, using it with cheats on disables achievements in that world. Most public servers disable /kill for regular players and offer a /suicide or /spawn plugin command instead.

Common mistakes

  • Running /kill @e without filters and losing pets, villagers and decorations.
  • Forgetting items are entities, so @e[type=!player] also deletes dropped loot and item frames.
  • Using Bedrock filters in Java: r and family do not work in Java; use distance and type.
  • Expecting a totem to save you: in Java it does not.

Related commands

  • /summon: spawn the mobs you just cleared.
  • /clear: remove items from inventories instead of the ground.
  • /gamerule: keepInventory to keep items when using /kill on yourself.
  • /tp: move entities instead of killing them.

/kill FAQ

How do you kill yourself in Minecraft?

Type /kill with cheats enabled.

How do you kill all mobs but not players?

Use /kill @e[type=!player], but this also deletes items and decorations. Target specific mob types to be safe.

How do you clear dropped items?

/kill @e[type=item].

Does /kill work on the Ender Dragon?

Yes.

/kill in command blocks and minigames

Map makers use /kill constantly. A repeating command block running /kill @e[type=item] near a parkour course stops players from dropping items to build shortcuts. In arena minigames, /kill @a[tag=eliminated] removes players who fail a challenge, and /kill @e[type=arrow] cleans up arrows between rounds. Combined with scoreboards and tags, /kill can reset an entire arena in one tick. Always test command block setups in a copy of your world first, because a mistake in the selector can wipe out entities you wanted to keep.

Selector filters you will use most

  • type: pick a mob or entity type, such as type=skeleton or type=item. Add an exclamation mark to exclude a type.
  • distance (Java) or r (Bedrock): limit the range around you, for example distance=..30 for 30 blocks.
  • limit and sort (Java): kill only the nearest few entities, such as limit=5,sort=nearest.
  • name: target or exclude entities with a specific custom name.
  • tag: kill only entities you tagged earlier with /tag.
  • family (Bedrock): target groups such as monster, undead or arthropod.

Combining two or three filters keeps /kill precise. For example, /kill @e[type=zombie,distance=..50] removes nearby zombies without touching a zombie you trapped as a pet on the other side of your base.

Undoing a mistake

There is no undo for /kill. If you accidentally remove pets, villagers or items, the only fixes are reloading a backup, or rebuilding with /summon and /give. Before running any broad /kill command on a world you care about, make a backup or test the selector with a harmless command first, such as /say @e[type=zombie,distance=..20], which lists what the selector would hit without killing anything.

On Realms, operators can use /kill the same way as on a private server.

For quick cleanups, start with the narrowest selector that works and widen it only if needed.

Remember that /kill on yourself drops your experience too, unless keepInventory is on.

Used carefully, /kill is one of the most useful cleanup tools in the game.

Bookmark this page for the selector examples above.

More about Minecraft

See all