Skip to content
[/craft]

Damage a Player or Mob

Deal a set amount of damage with a command

✅ Verified for Java 26.2 · Bedrock 26.32 — checked June 2026

Deals a precise amount of damage to the targeted entity, optionally with a damage type. This example deals 6 damage (three hearts) as magic damage to yourself. The damage type controls armor and effect interactions; on Java it is a namespaced ID (minecraft:magic, minecraft:fall, etc.) and on Bedrock a short cause name. Great for scripted traps and testing.

/damage @s 6 minecraft:magic
28 characters

How to use

  1. Open chat (T on Java, / on Bedrock).
  2. Paste the command, choosing the target and amount.
  3. Optionally set a damage type at the end.
  4. Press Enter — the target takes the damage immediately.

Related commands

Make chat text a clickable button that runs a command

/tellraw @a {text:"[Click to teleport to spawn]",color:green,click_event:{action:run_command,command:"/spawn"}}

Mount the closest horse with a command

/ride @s mount @e[type=horse,limit=1,sort=nearest]

Become nearly invincible

/effect give @p resistance 999999 255 true

Switch yourself into Creative mode

/gamemode creative

Instantly remove every mob from the world except players

/kill @e[type=!player]

Give yourself XP levels for enchanting

/experience add @p 30 levels