Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/damage

Command

/damage

Deals a chosen amount of damage to an entity, optionally with a damage type and an attacker.

Syntax

/damage <target> <amount>
/damage <target> <amount> <damageType>
/damage <target> <amount> <damageType> at <location>
/damage <target> <amount> <damageType> by <entity> [from <cause>]

Arguments

ArgumentKind of valueWhat to type
<target>Target selectorThe entity to damage. Must be exactly one entity. One entity only.
<amount>Decimal numberHow much damage to deal, in health points. 2 points are one heart. A number of 0 or more. At least 0.
<damageType>Game idThe 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 positionFor at: the position the damage comes from.
<entity>Target selectorFor by: the entity that directly deals the damage. One entity only.
<cause>Target selectorFor from: the entity ultimately responsible for the damage. One entity only.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inSingleplayer with cheats enabled and multiplayer servers. Needs permission level 2 (gamemasters): server operators, players with cheats, command blocks, and functions can all run it.
ResultReports "Applied" with the amount of damage and the target's name. The number /execute store saves is 1.
Default damage typeWithout a damage type, minecraft:generic is used.
atGives the damage a position it comes from, with no attacking entity.
byNames the entity that deals the damage. On its own, that entity counts as both the direct source and the one responsible.
by ... fromSeparates 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.
FailureFails 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 targetOnly a single entity can be damaged per command.

Examples

/damage @s 4

Deals 2 hearts of generic damage to you.

/damage @e[type=minecraft:zombie,limit=1,sort=nearest] 10 minecraft:magic

Deals 5 hearts of magic damage to the nearest Zombie.

/damage @s 6 minecraft:fall

Hurts you for 3 hearts as fall damage.

/damage @p 5 minecraft:player_attack by @s

Damages the nearest player as if you had attacked them.

/damage @s 8 minecraft:explosion at ~ ~ ~5

Hurts you with explosion damage coming from 5 blocks away.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)