MiniBench

MiniBench / Learn / Commands

Command Bedrock Edition ~2 min read

The /damage command

Deal a precise amount of damage to a player or mob — traps, hazards, and effects.

What it does

/damage hurts an entity by an exact amount. Use it for a lava-free trap, a poison zone, a boss attack, or any hazard where you want control over how much it hurts.

Syntax

damage <target> <amount> [cause]
target
Who takes damage — @s, @a, or a filtered selector.
amount
Half-hearts of damage (2 = one heart).
cause
Optional damage type, e.g. fire, magic, fall.

Examples

damage @s 4

Two hearts of damage to yourself.

damage @e[type=zombie,r=5] 100

Wipe out nearby zombies.

damage @a[tag=trapped] 6 fire

Fire damage to tagged players.

See it in action

Before and after running /damage — in MiniBench's 3D preview and in Minecraft.

Command run

damage @s 10
In Minecraft
Player health reduced by /damage in Minecraft (before)

Before

Player health reduced by /damage in Minecraft (after)

After

Not affiliated with Mojang or Microsoft. Minecraft is a trademark of Mojang Synergies AB.

Watch out for

Write it in MiniBench with autocomplete and live validation, then run it in Minecraft.