/attribute @s minecraft:max_health getThe /attribute command reads and changes entity stats. Use get to read a value, base set to change the default, or modifiers to stack adjustments on top.
The /attribute command reads, sets, and modifies the numerical stats that control how entities behave: max health, movement speed, attack damage, scale, gravity, and more. This generator builds the correct syntax for any of those operations without editing NBT data directly.
Attributes define how entities perform. A player's max_health defaults to 20 (10 hearts) and a zombie's movement_speed is 0.23. The /attribute command changes these values at runtime, which makes it essential for custom boss mobs, minigame mechanics, and player scaling.
Each command targets one entity selector and one attribute, then applies an operation: get reads a value, base set changes the default, and modifier stacks adjustments on top using the three operation types.
| Command | Effect |
|---|---|
| /attribute @s minecraft:max_health get | Reads your current max health value |
| /attribute @s minecraft:max_health base set 40 | Sets your base max health to 40 (20 hearts) |
| /attribute @s minecraft:movement_speed modifier add speed_boost 0.5 add_multiplied_base | Adds a modifier that raises speed by 50% of the base |
| /attribute @s minecraft:scale base set 5 | Makes you five times your normal size |
| /attribute @e[limit=1] minecraft:gravity base set 0 | Removes gravity from the nearest entity so it floats |
Modifier operations: add_value adds a flat number to the base. add_multiplied_base multiplies the base by a percentage (0.5 = +50% of base). add_multiplied_total multiplies the running total after the other operations. Order matters: add_value runs first, then add_multiplied_base, then add_multiplied_total.
Boss mobs: raise max_health and attack_damage, then set scale to 3 to 5 for a giant that hits hard and soaks damage. After raising max health upward, top the mob off with an Instant Health effect to fill the new pool.
Custom movement: set gravity to 0 for floating entities or a negative value for entities that fall upward. Raise step_height to 3 so mobs walk over fences and walls, and increase safe_fall_distance to make entities immune to fall damage from any height.
Attributes are numerical properties that control entity behavior: max health, movement speed, attack damage, armor, gravity, scale, and more. They can be modified with the /attribute command, through NBT data, or via enchantments and equipment.
Use /attribute @e[type=minecraft:zombie,limit=1] minecraft:max_health base set 100 to set a zombie's max health to 100 HP (50 hearts). After changing max health upward, heal the mob with /effect give Instant Health to fill the new health pool.
Base values are the default attribute number (player max_health base = 20). Modifiers are adjustments applied on top of the base using three operations: add_value (flat addition), add_multiplied_base (percentage of base), and add_multiplied_total (percentage of running total). Equipment, enchantments, and effects all work through modifiers.
Set minecraft:scale with base set, for example /attribute @e[limit=1] minecraft:scale base set 5 for a mob five times its normal size, or 0.2 for a tiny version. Scale changes the hitbox, model size, and step height proportionally.
Browse more Minecraft tools: