EntitiesJavaBedrock

/damage

Deals a precise amount of damage to entities using a chosen damage type, which determines armor/effect interactions and the death message. Optionally attribute the damage to an attacker or a source position (for knockback direction). Added in 1.19.4.

Syntax

Parameters

target
entity selector
Entities to hurt.
amount
float
Half-hearts of damage (2 = 1 heart).
damageTypeoptional
damage type ID
e.g. minecraft:magic, minecraft:fall.

Examples

  • Take 3 hearts of generic damage.

  • Magically wipe out all zombies.

Permission level

/damage requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.