/damage @p 4 minecraft:player_attackThe /damage command (Java 1.19.4+) deals damage to entities. The damage type determines how armor and enchantments interact with the damage. Use at to specify where the damage comes from (for knockback direction) or by to specify the attacking entity.
The /damage command deals a precise amount of damage to any entity using a chosen damage type. Unlike /kill, which removes an entity instantly, /damage applies a set HP amount that respects armor, enchantments, and effects, making it ideal for custom combat systems, traps, and boss mechanics.
The syntax is /damage [target] [amount] [damageType] [at position | by entity]. The amount is measured in HP, where 1 HP is half a heart, so a full-health player has 20 HP. The damage type controls how armor, enchantments, and difficulty scaling apply to that amount.
Each damage type behaves differently: some bypass armor (magic, starve, out_of_world), some apply burning or freezing effects, and some scale with difficulty. Pick the type that matches the hazard you want to model, then set a source position or attacking entity for knockback.
1. Pick a target selector (@s, @p, @e, @a, @r) or aim the command at a player.
2. Set the damage amount in HP. One HP is half a heart, so 20 HP is full health.
3. Choose a damage type. Each one interacts differently with armor, enchantments, and mob properties.
4. Optionally set a source: an entity (by) or a position (at). This sets knockback direction and the death message.
5. Copy the command and paste it into Minecraft chat or a command block.
Each damage type has its own exhaustion cost and scaling behavior. Here are the key categories:
| Damage Type | Exhaustion | Scaling | Notes |
|---|---|---|---|
| player_attack | 0.1 | Non-player only | Standard melee hit |
| mob_attack | 0.1 | Non-player only | Zombie, skeleton melee, etc. |
| arrow | 0.1 | Non-player only | Bow and crossbow projectiles |
| fall | 0 | Non-player only | Fall damage, uses fall messages |
| explosion | 0.1 | Always | TNT, creeper blasts |
| lava | 0.1 | Non-player only | Applies burning effect |
| drown | 0 | Non-player only | Applies drowning effect |
| starve | 0 | Non-player only | Bypasses armor |
| magic | 0 | Non-player only | Bypasses armor |
| freeze | 0 | Non-player only | Powder snow, applies freezing |
| sonic_boom | 0 | Always | Warden ranged attack, bypasses armor |
| mace_smash | 0.1 | Non-player only | Mace fall attack |
| wind_charge | 0.1 | Non-player only | Breeze wind charge projectile |
| out_of_world | 0 | Non-player only | Void damage, bypasses everything |
Exhaustion is how much hunger the damage costs the player on top of the HP loss. Scaling controls whether difficulty level changes the amount: "always" scales on every difficulty, "non-player only" scales only when a non-player entity causes it.
The /damage command deals a specified amount of HP damage to a target entity using a chosen damage type. The syntax is /damage <target> <amount> [<damageType>] [at <position> | by <entity>]. It respects armor, enchantments, and resistance effects based on the damage type chosen.
Java Edition registers dozens of damage types, including physical types like player_attack, mob_attack, and arrow, environmental types like fall, drown, and freeze, fire types like in_fire and lava, and special types like sonic_boom and mace_smash. The version selector loads the exact set for the version you pick.
It depends on the damage type. Types like magic, starve, and out_of_world bypass armor entirely. Physical types like player_attack and mob_attack are reduced by armor and protection enchantments. The damage type's scaling setting also controls whether difficulty level changes the final amount.
Use the by option: /damage @p 4 minecraft:mob_attack by @e[type=zombie,limit=1]. The knockback then comes from that entity instead of the command block. Use at <x> <y> <z> instead to push the target away from a fixed position.
Damage is measured in HP, where 1 HP equals half a heart. A full-health player has 20 HP, which is 10 hearts. So /damage @s 6 removes three hearts before armor and enchantments are applied.
Browse more Minecraft tools: