Mastering the Minecraft Mob-Killing Commands: A Comprehensive Guide
There are many reasons to eliminate mobs in Minecraft. The most straightforward method involves commands, specifically the /kill
command. However, this seemingly simple command has nuances. This guide explains how to target and eliminate mobs effectively.
Prerequisites: Enabling Cheats
Before using any kill commands, ensure your world has cheats enabled. If you're unsure how, skip to the "Enabling Cheats" section below.
The /kill
Command: Syntax and Usage
The basic /kill
command, when entered alone (/kill
), targets the player. To specify targets, use the following syntax:
-
/kill @e[type=!minecraft:player]
: This command eliminates all entities except the player.@e
selects all entities, and[type=!minecraft:player]
excludes players. -
/kill @e[type=minecraft:chicken]
: This targets and kills only chickens. Replaceminecraft:chicken
with the desired mob type (e.g.,minecraft:sheep
,minecraft:zombie
). -
Targeting by Distance:
-
Java Edition:
/kill @e[distance=..15]
kills all entities within 15 blocks. You can specify a range (e.g.,distance=10..15
for mobs between 10 and 15 blocks away). -
Bedrock Edition:
/kill @e[r=10]
achieves the same result using ther
parameter for radius.
-
-
Combining Type and Distance:
-
Java Edition:
/kill @e[distance=..15,type=minecraft:sheep]
kills sheep within 15 blocks. -
Bedrock Edition:
/kill @e[r=10,type=minecraft:sheep]
performs the equivalent action.
-
Command autocompletion simplifies the process; you don't need to memorize the exact syntax.
Important Selectors:
Beyond @e
, other useful selectors include:
@p
: The nearest player@r
: A random player@a
: All players@s
: Yourself
Enabling Cheats/Commands in Minecraft
Commands won't function without cheats enabled. Here's how to activate them:
Java Edition
- Enter your world.
- Press Esc.
- Select "Open to LAN."
- Toggle "Allow Commands" to "On."
This enables commands for the current session. To permanently enable cheats, create a world copy with cheats enabled using the "Re-create" option in the singleplayer menu.
Bedrock Edition
- Navigate to your worlds.
- Select the world and click the pencil icon.
- In the settings menu, toggle "Cheats" to "On."
Minecraft is available on PlayStation, Xbox, Nintendo Switch, PC, and mobile.