EntitiesJavaBedrock
/attribute
Reads or changes entity attributes such as max health, movement speed, attack damage, and armor. You can set the base value directly or attach named modifiers (add/multiply) that stack on top of the base — the same mechanism gear and effects use.
Syntax
Alternate forms:
Parameters
- target
- entity selector
- Single entity to read/modify.
- attribute
- attribute ID
- e.g. minecraft:max_health, minecraft:movement_speed.
- operation
- literal
- get, base (get/set), or modifier (add/remove/value).
Examples
Set your max health to 20 hearts.
Read your current base move speed.
Make the nearest zombie hit harder.
Permission level
/attribute 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.