Golden apple

Minecraft Attribute Command Generator

Attributes are the underlying stats of every living entity. Java 1.21.2 dropped the generic. prefix from the attribute ids, so a command that works on one version silently targets nothing on the other. Pick the version and the generator writes an id your world accepts.

  • max_health, movement_speed, attack_damage, attack_speed and knockback_resistance
  • base set, base add and modifier operations
  • generic.max_health below 1.21.2, max_health at and above it

Read the matching guide

Example commands

Double max health

/attribute @p minecraft:max_health base set 40

base set 40 is twenty hearts; heal up afterwards -- raising the max does not fill it.

Faster movement

/attribute @p minecraft:movement_speed base set 0.2

Default player speed is 0.1; 0.2 doubles it.

Knockback-immune boss

/attribute @e[type=zombie,limit=1,sort=nearest] minecraft:knockback_resistance base set 1

knockback_resistance 1 shrugs off every hit -- a staple for arena bosses.

FAQ

Why does my /attribute command target nothing on 1.21.2+?

Java 1.21.2 dropped the generic. prefix from attribute ids: generic.max_health became max_health, generic.movement_speed became movement_speed. A command with the old prefix silently matches no attribute. Pick your version and the generator writes the right id.

How do I give a mob more than 20 health?

Set the max_health attribute base value, then heal the entity (or set its Health) up to the new maximum. Raising max_health alone does not fill the extra hearts, which is why summoned bosses sometimes spawn at partial health.

What is the difference between base and modifier operations?

base set/base add change the attribute directly and persist on that entity; a modifier is a named, stackable adjustment (add_value, add_multiplied_base, add_multiplied_total) that items and effects use. Use base for a permanent stat, a modifier for a temporary or gear-driven one.

Does /attribute work on Bedrock?

Bedrock has no /attribute command; attributes there are set through entity NBT or components. The generator marks the command as Java Edition only.