Commands/kill
Minecraft Wiki article. Categories: Commands
This article is reproduced from Commands/kill on the Minecraft Wiki. Mirrored from revision 3721700. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.
/kill{
"title": "<code>/kill</code>",
"rows": [
{
"field": "\n* 2 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Java Edition\">(link to Java Edition article, displayed as JE) only</span></i>]</sup>\n* 1 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "(link to Cheat article, displayed as Cheat) only<sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Kills entities (players, mobs, items, etc.).
Usage
Directly kills living targets compulsorily (directly removes the entity) and prompts Killed <entity display name>, or <Killed <number> entities if multiple entities are killed, which is irrespective of any of the targeted mob(s)' protective effects (armor, Protection, and Resistance). However, the damage can be adjusted by the ender dragon. Totems of undying can't be triggered when their owner(s) die(s) because of this command.
When the command kills mob(s), it issues the appropriate death message. Players and mobs killed this way drop loot, and slimes, magma cubes, and sulfur cubes that are not of minimum size spawn smaller ones. Non-mob entities disappear if they are targeted.
In Java Edition, ender dragons killed by this command will skip their death animation and immediately open the exit portal.
In Bedrock Edition, players in Creative mode cannot be killed using this command.
Syntax
- Java Edition
kill [<targets>]
- Bedrock Edition
kill [target: target]
Arguments
JE: <targets>: entity
BE: target: target: CommandSelector<Actor>
- Specifies the target(s) to kill. If not specified, defaults to the player who executed the command.
- Must be a player name, a target selector or a UUID[Java Edition only].
Result
| Command | Trigger | Java Edition | Bedrock Edition |
|---|---|---|---|
| Any | Any argument is not specified correctly. | Unparseable | Unparseable |
<targets> or target: target is not specified when the command's executor is not an entity. | Failed | Failed | |
<targets> or target: target fails to resolve to one or more entities (named players must be online). | |||
| All the targets are creative-mode players. | Successful | ||
| Otherwise | Successful | ||
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
| On success | 1 | 1 | the number of targeted entities | ||
| Bedrock Edition | On fail | 0 | N/A | N/A | |
| On success | the number of entities that are killed | N/A | N/A |
Examples
- To kill the player executing the command:
kill @sorkill - To kill the player Steve:
kill Steve - To kill item entities:
kill @e[type=item] - To kill all entities except players (if there are too many entities, some won’t be killed.) :
kill @e[type=!player] - To kill all creepers within 10 blocks:
- To kill all arrows that are stuck in a target:
kill @e[type=arrow,nbt={inBlockState:{Name:"minecraft:target"}}][Java Edition only]
History
Java Edition
| Java Edition Alpha | |||||||
|---|---|---|---|---|---|---|---|
| v1.2.6 | server 0.2.8 | Added /kill. It currently deals 1000HP × 500 damage. | |||||
| Java Edition | |||||||
| 1.3.1 | 12w16a | /kill is now usable in singleplayer. | |||||
Parsing of the command is now more strict, rejecting extra characters after the command name (such as /killme or /killed). However, arguments are still ignored, meaning /kill playername still only kills the executor. | |||||||
/kill now uses void damage instead of generic damage, bypassing armor. The death message is now "player fell out of the world" instead of "player died". | |||||||
/kill now prints the message "Ouch. That look [sic] like it hurt." on execution. | |||||||
| 1.6.1 | 13w24b | /kill now deals 3.4×1038 damage. | |||||
| 1.8 | 14w02a | Added (player|entity) argument to /kill. | |||||
| Replaced the "Ouch! That looked like it hurt" message with "Killed player". | |||||||
| 14w02c | To fix MC-44371, /kill now directly kills non-living targets. | ||||||
| 1.13 | 17w45a | <target> argument is no longer optional. | |||||
| 1.15 | 19w38a | <target> argument is once again optional. | |||||
| 1.20 | Pre-release 1 | /kill now uses generic_kill type damage instead of void damage. | |||||
Bedrock Edition
| Pocket Edition Alpha | |||||||
|---|---|---|---|---|---|---|---|
| v0.16.0 | build 1 | Added /kill. | |||||
External links
- "
/killCommand" – Microsoft Learn, October 11, 2023.
Navigation
Sources
- Commands/kill — Minecraft Wiki, CC BY-NC-SA 3.0, revision 3721700.