
Command
/damage
Deals a chosen amount of damage to an entity, optionally with a damage type and an attacker.
| /damage <target> <amount> |
| /damage <target> <amount> <damageType> |
| /damage <target> <amount> <damageType> at <location> |
| /damage <target> <amount> <damageType> by <entity> [from <cause>] |
| Argument | Kind of value | What to type |
|---|---|---|
| <target> | Target selector | The entity to damage. Must be exactly one entity. One entity only. |
| <amount> | Decimal number | How much damage to deal, in health points. 2 points are one heart. A number of 0 or more. At least 0. |
| <damageType> | Game id | The damage type id, for example minecraft:fall, minecraft:magic, minecraft:on_fire, or minecraft:player_attack. It decides the death message and which protections apply. The id of a damage type. |
| <location> | Exact position | For at: the position the damage comes from. |
| <entity> | Target selector | For by: the entity that directly deals the damage. One entity only. |
| <cause> | Target selector | For from: the entity ultimately responsible for the damage. One entity only. |
| Permission level | 2: operators, worlds with cheats on, command blocks and functions |
| Works in | Singleplayer with cheats enabled and multiplayer servers. Needs permission level 2 (gamemasters): server operators, players with cheats, command blocks, and functions can all run it. |
| Result | Reports "Applied" with the amount of damage and the target's name. The number /execute store saves is 1. |
| Default damage type | Without a damage type, minecraft:generic is used. |
| at | Gives the damage a position it comes from, with no attacking entity. |
| by | Names the entity that deals the damage. On its own, that entity counts as both the direct source and the one responsible. |
| by ... from | Separates the two roles: the entity after "by" is the direct source, such as an Arrow, and the entity after "from" is the one responsible, such as the Skeleton that shot it. |
| Failure | Fails with "Target is invulnerable to the given damage type" if the target takes no damage, for example a player in Creative mode hit with a normal damage type. |
| One target | Only a single entity can be damaged per command. |
/damage @s 4Deals 2 hearts of generic damage to you.
/damage @e[type=minecraft:zombie,limit=1,sort=nearest] 10 minecraft:magicDeals 5 hearts of magic damage to the nearest Zombie.
/damage @s 6 minecraft:fallHurts you for 3 hearts as fall damage.
/damage @p 5 minecraft:player_attack by @sDamages the nearest player as if you had attacked them.
/damage @s 8 minecraft:explosion at ~ ~ ~5Hurts you with explosion damage coming from 5 blocks away.




