Skip to content
MC Command Generator

/attribute Command Generator

Beta

Pick an attribute and what to do with it: read it, set its base value or stack modifiers on it. The preview works out the final value the way the game does and shows it as hearts, a resized player or a bar.

Describe it — AI writes the command

Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.

Checking the AI…

Paste a command— edit it here or move it to another version
ModifiersID = resource location
Max Health@s
Base20
+4 (my_pack:extra_hearts)24
+50% of 24 (my_pack:tough)36
Final36
Shown for a player (base 20; mobs have their own base values). The game clamps Max Health between 1 and 1024.

Your command · Java 26.3

166 characters
/attribute @s minecraft:max_health modifier add my_pack:extra_hearts 4 add_value
/attribute @s minecraft:max_health modifier add my_pack:tough 0.5 add_multiplied_base
  • Adding a modifier whose ID the entity already has fails — remove it first to change it.
  • One line per modifier: run them all (a function file or a chain of command blocks does it in one go).

Raw editor

How it works

Ten extra hearts and double size on the player running the command, in each format:

Java 1.21.2 and later

attribute @s minecraft:max_health base set 40
attribute @s minecraft:scale base set 2
attribute @s minecraft:max_health modifier add my_pack:extra_hearts 4 add_value
attribute @s minecraft:max_health base reset          (1.21.4+)

Java 1.21 and 1.21.1

attribute @s minecraft:generic.max_health base set 40
attribute @s minecraft:generic.max_health modifier add my_pack:extra_hearts 4 add_value

Attributes had a generic. prefix until 1.21.2 (player. for reach and mining ones, zombie. for spawn reinforcements, and horse.jump_strength before 1.20.5). The generator adds the right one for your version, so you only pick max_health.

Java 1.16 to 1.20.6

attribute @s minecraft:generic.max_health modifier add ea092427-6500-4bcd-9103-ea13720f53c5 "my_pack:extra_hearts" 4 add

Before 1.21 a modifier is a UUID plus a name. The generator makes the UUID from the ID you type, so the same ID always gives the same UUID and you can remove it later. You can paste your own UUID instead. The operations were called add, multiply_base and multiply until 1.20.5 renamed them add_value, add_multiplied_base and add_multiplied_total. Scale, gravity, step height and reach arrived in 1.20.5; Java 1.15 and older have no /attribute.

How modifiers stack

The game adds every add_value to the base, then adds base × each add_multiplied_base, then multiplies by (1 + amount) for each add_multiplied_total. With 20 health, +4 and +0.5 multiplied base gives (20 + 4) × 1.5 = 36. The result is clamped to the attribute’s range (max health 1 to 1024, scale 0.0625 to 16). Bedrock has no /attribute. To give a mob attributes as it spawns, use /summon.

FAQ

How do I give myself more hearts?

attribute @s minecraft:max_health base set 40 gives 20 hearts (Java 1.21.2+; older versions write minecraft:generic.max_health). New hearts start empty, so heal with /effect instant_health or wait to regenerate.

How do I make a player bigger or smaller?

Set the scale attribute, added in Java 1.20.5: attribute @s minecraft:scale base set 2 doubles your size. It goes from 0.0625 to 16.

Why does my /attribute command say the attribute is unknown?

The generic. prefix was dropped in Java 1.21.2: minecraft:generic.movement_speed only works up to 1.21.1, minecraft:movement_speed only from 1.21.2. Pick your version and the generator writes the right name.

What is the difference between base value and a modifier?

The base value is the starting number and persists on the entity. Modifiers are added on top with an ID, so several sources (armour, effects, your commands) can stack and each can be removed on its own.

How do I reset an attribute?

Java 1.21.4+ has attribute @s minecraft:max_health base reset. Older versions need base set with the normal value, such as 20 for a player's max health or 0.1 for movement speed.