Minecraft has a powerful command that can kill everything in your world. It is a very handy tool that you can use, especially when many mobs are spawning in the area.
Most of the mobs do not necessarily despawn, due to which your game could lag as well. The kill command comes in very handy in such situations. So, without further ado, let’s look at how to use the kill command to all mobs in Minecraft.
Kill Command in Minecraft
The kill command is the command you write in the chat box in the game. There is only one kill command, /kill;
but there are different variations of it. You can use the command to kill every living mob in the game, including you. You can also kill only a certain type of creature or kill the players only.
One good thing about this command is that you can use it to destroy all the drops and entities left in the game, such as creature drops, minecarts, boats, etc.
It is best to remember that you can only use commands after activating cheats in your world. You can do so while creating the world or turning the LAN multiplayer on and allowing cheats.
How to Use the Kill Command in Minecraft?
It is very easy to use the kill command. You can open the chatbox, enter the command you want to execute, and hit Enter. However, there are many different ways to use the command.
Using the Command to Kill Everything
The first and the basic way to use the command is to kill all the entities of the game:
- Open the chatbox by pressing T on your keyboard.
- Type in the command:
/kill @e
and hit Enter. - Every entity in the game, including yourself, dies after executing the command.
Using the Command to Kill Everything Except the Player
You can also kill everything except yourself. You can follow the following steps to do so:
- Open chatbox and enter the following command:
/kill @e[type=!player]
and hit Enter.- Using this command will kill all the entities except yourself.
- Additionally, you can also use the same command to exclude certain things from dying by using the following example:
/kill @e[type=!player,type=!ocelot,type=!wolf,type=!armor_stand]
- Executing the abovementioned command kills everything except Ocelot, wolf, armor stand, and of course, you. Since there are non-living items such as the armor stand and the minecart that you can summon in the game, they also fall under entities and will die when you use the kill command.
Using the Kill Command to Kill a Certain Mob
This is a handy way of getting rid of a certain type of mob if they give you a lot of trouble. Let’s look at the command that kills pillagers for an easier demonstration:
- Open the chat and type
/kill @e[type=pillager]
- Hit Enter once you are sure the command is correct.
- Executing this command will kill all the pillagers in the world.
Using the Kill Command to Kill Mobs in a Small Area
Another variation of the kill command also lets you kill everything in an area. You will need to determine the number of blocks around you that you want to execute the command in. Let us look at an example of how to kill mobs in a distance of 20 blocks.
- Open your chatbox and enter the command below:
/kill @e[distance=..20]
- Executing this command will kill everything in a radius of 20 blocks, including you.
- In order to not kill yourself, you have to add type=!player after the distance. For instance:
/kill @e[distance=..20,type=!player]
- You can also use the command to kill only one type of mob within the area, for example:
/kill @e[distance=..20,type=creeper]
- Executing this command will let you kill every creeper 20 blocks from you.
- It is best to remember that the distance will not work in Bedrock Edition. You will have to write ‘r’ instead of distance like in the example below:
- /kill @e[r=20]
Using the Kill Command to Kill another Player
If you are playing in multiplayer mode and have admin privileges, you can easily kill other players using the following command:
/kill playername
In the above syntax, the player name is the name of the player you want to kill in the game. But you may want to check if they are online in your world before executing the command; else, you will face an error while doing so.
Finally…
Now that you know about the kill command, you can make full use of it to change the world to your liking or optimize it better. But it is best to make sure you try all the different variations of the kill command in a different world so that you do not accidentally kill something you don’t want to.
Creating a different world in creative mode and experimenting with the command will help you know how the command truly functions. It will certainly help you use it better in your actual world.