OmniGame logoOmniGame

/attribute Command

Reads or modifies the base value of an entity attribute, or manages transient attribute modifiers that are applied on top of the base value.

Syntax
attribute <target> <attribute> get [<scale>] attribute <target> <attribute> base get [<scale>] attribute <target> <attribute> base set <value> attribute <target> <attribute> modifier add <id> <value> add|multiply_base|multiply attribute <target> <attribute> modifier remove <id> attribute <target> <attribute> modifier value get <id> [<scale>]
Permission: 2 (gamemaster / cheats enabled)Edition: Java

Examples

/attribute @s minecraft:generic.max_health base set 40/attribute @s minecraft:generic.movement_speed base get/attribute @s minecraft:generic.attack_damage modifier add 12345678-1234-1234-1234-123456789abc 10 add/attribute @s minecraft:generic.armor base set 20

Notes

Java Edition exclusive. The modifier id is a UUID in Java Edition 1.20.2 and earlier; from 1.20.5+ it is a namespaced string identifier (e.g. mymod:speed_boost). Operation add adds flat value; multiply_base multiplies base before additions; multiply multiplies the final sum. Common attributes: minecraft:generic.max_health, minecraft:generic.movement_speed, minecraft:generic.attack_damage, minecraft:generic.armor, minecraft:generic.luck.

More commands