The /attribute Command in Minecraft: Size, Health, Speed and Jump
With /attribute you change what a player or a mob is like without mods or plugins: their size, their hearts, how fast they run, how high they jump, gravity or how far they can reach. It's a Minecraft Java command and the names changed in 1.21.2: that's why lots of commands from old videos don't work anymore.
How it's written and who can use it
The form is /attribute <target> <attribute> and what you want to do: get to see its current value, base set <number> to change its base value, base reset to put it back to the default, and modifier to add or take something away under a name of your own (further down).
It needs permission level 2: on a server, being op (op YourName in the console); in a singleplayer world, having cheats on. It doesn't exist in Bedrock.
It works on ONE entity at a time. With @a or @e without a limit you get the error «Only one entity is allowed». To change it for everyone, repeat it with execute: /execute as @a run attribute @s minecraft:scale base set 0.5.
Since 1.21.2 attributes are named without a prefix: minecraft:scale, minecraft:max_health, minecraft:movement_speed. If you copy generic.scale or generic.max_health from an old tutorial, it fails because that name no longer exists. Tab in chat shows you the exact list for your version.
Rather not set it up yourself? Minecraft servers from €6 a month, no contract and a full refund within 72 hours. Or create a free Minecraft server, no card needed.
Making yourself tiny or giant: scale
/attribute YourName minecraft:scale base set 0.5 makes you half as tall; base set 2, twice as tall. It accepts 0.0625 (one sixteenth) to 16, and the default is 1. It's been around since 1.20.5.
It also changes the size you collide with: at 0.5 you're 0.9 blocks tall and fit through one-block gaps; at 3 you don't fit through a door. For a giant, also raise how far they can reach (minecraft:block_interaction_range, base 4.5) or they won't comfortably reach the ground.
It's great for events (a giant boss, a race of tiny players), for screenshots and for roleplay. To go back to your size: /attribute YourName minecraft:scale base reset.
The most used attributes
More hearts: minecraft:max_health, base 20 (ten hearts), up to 1024. base set 40 gives twenty hearts. The new ones start empty: they fill up by eating or with /effect give YourName minecraft:instant_health (the /effect guide).
Run faster: minecraft:movement_speed, base 0.1 on a player. base set 0.2 is twice as fast; above 0.3 it gets hard to control.
Jump higher: minecraft:jump_strength, base 0.42. At 1 you jump several blocks; also raise minecraft:safe_fall_distance (base 3, the blocks you can fall without taking damage) or set minecraft:fall_damage_multiplier to 0 so the fall doesn't kill.
Step up blocks without jumping: minecraft:step_height, base 0.6. At 1 you walk up a block, like a horse.
Moon gravity: minecraft:gravity, base 0.08. At 0.02 you fall slowly and jumps last ages. It accepts -1 to 1.
Reach: minecraft:block_interaction_range (blocks, 4.5) and minecraft:entity_interaction_range (hitting mobs and players, 3). Handy in creative mode to build from far away.
Others worth knowing: minecraft:attack_damage (damage with your fist), minecraft:armor (up to 30), minecraft:knockback_resistance (0 to 1: at 1 nothing pushes you), minecraft:oxygen_bonus (more air underwater), minecraft:mining_efficiency and minecraft:block_break_speed (mine faster) and minecraft:burning_time (how long it takes you to stop burning; at 0, none). The 26.x versions have added a few more, like minecraft:bounciness or minecraft:friction_modifier.
base set or modifier: which to use
base set changes the base value and that's it: it's the simplest and almost always what you're after.
modifier adds a change under a name of its own, on top of whatever is there: /attribute YourName minecraft:movement_speed modifier add napnodes:fast 0.5 add_multiplied_base makes you run 50% faster, and /attribute YourName minecraft:movement_speed modifier remove napnodes:fast removes it without touching anything else. It's useful when several things change the same attribute (an event, a rank, an effect) and you only want to remove yours.
There are three ways to add: add_value adds the number as is (0.05 more speed), add_multiplied_base adds a percentage of the base value (0.5 is 50% more) and add_multiplied_total multiplies the total at the end, after everything else. You pick the name (napnodes:fast); adding it again with the same name gives an error: remove it first.
/attribute YourName minecraft:movement_speed get tells you the final value with everything added; base get, only the base. If something doesn't add up, compare the two.
On mobs: custom bosses and pets
An existing mob is changed the same way, targeting just one: /execute as @e[type=minecraft:zombie,limit=1,sort=nearest] run attribute @s minecraft:scale base set 3 turns the nearest zombie into a giant.
To spawn it already changed, with summon: /summon minecraft:zombie ~ ~ ~ {attributes:[{id:"minecraft:scale",base:3},{id:"minecraft:max_health",base:100}],Health:100f} spawns a zombie three times bigger with 100 health (the Health is needed: otherwise it spawns with normal health even though its maximum is 100).
With minecraft:follow_range (how far away it chases you) and minecraft:attack_damage you get an event boss without plugins. So it doesn't despawn when you walk away, add PersistenceRequired:1b inside the braces.
Common problems
«Only one entity is allowed, but the provided selector allows more than one»: you used @a or @e. Use a name, @s, @p, add limit=1 or do it with execute as @a run … @s.
Error with generic.whatever: that's the name from before 1.21.2. Drop the generic. (or the player. from block_interaction_range).
It goes back to normal after dying: respawning recreates the player and whatever you changed with base set goes back to its value. If it needs to last (a rank, a world of giants), it has to be set again after every death: with a repeating command block or a function, or with a plugin. Logging out and back in, or restarting the server, does keep it: it's saved with the player.
You gave yourself 1024 hearts or an impossible speed and nobody can play: /attribute YourName <attribute> base reset puts it back; if it was with modifier, modifier remove with the same name.
A command block does nothing: since 1.21.9 they're turned on with the game rule command_blocks_work (gamerule command_blocks_work true), not in server.properties anymore.
On NapNodes
Minecraft servers are delivered on Paper with the latest version, so /attribute has today's names. Type it in the game chat while you're op, or in the server's «Console» in the panel, without the slash and with the player's name instead of @s: attribute YourName minecraft:scale base set 2.
Game rules, like the command block one («Enable Command Blocks»), are also in «Settings», with plain names: they change with the server on and apply to the overworld, the Nether and the End at once.
Whatever you change is saved with each player in the world: if you're going to run big tests before an event, first make a copy in «Backups» and restore it if something goes wrong.
Frequently asked questions
How do I make myself tiny or giant in Minecraft with commands?
With /attribute YourName minecraft:scale base set 0.5 (half) or base set 2 (double), in Java 1.20.5 or later and as op. It goes from 0.0625 to 16; base reset puts you back to your size.
How do you get more hearts in Minecraft?
/attribute YourName minecraft:max_health base set 40 gives twenty hearts (the default is 20 points, ten hearts). The new ones start empty and fill up by eating or healing.
Why doesn't /attribute generic.scale work?
Since 1.21.2 attributes are named without generic.: it's minecraft:scale, minecraft:max_health, minecraft:movement_speed…
How do I change an attribute for every player at once?
/attribute works on a single entity: use /execute as @a run attribute @s minecraft:scale base set 0.5.
Are attributes lost on death?
Whatever you changed with base set goes back to its value on respawn. Logging out or restarting the server does keep it, because it's saved with the player.
Does /attribute exist in Bedrock?
No. It's a Minecraft Java command.
Shall we set it up for you?
Minecraft servers from €6 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Minecraft server, no card needed.
Your server doesn't show up in the game? Check it in a second with “Is my Minecraft server online?”: players, version and MOTD, free. Need a player's UUID for the whitelist or permissions? Look it up here. Handing out enchanted items? Build the command with the /give generator.
Keep reading
- The /summon Command in Minecraft: Spawn Mobs With a Name, Gear and Health
How to use /summon in today's Minecraft: named mobs, no AI, babies, armour or more health, riders, the usual errors and how to use it from the console.
- The /effect Command in Minecraft: Give Effects, Make Them Infinite and Clear Them
How to use /effect in Minecraft: infinite night vision, speed or strength at any level, no particles, clearing effects and the list of all 41 effect IDs.
- Minecraft 26.4 on Your Server: Ice Caves, the Frostbite and How to Get Ready Before It Lands
What Minecraft 26.4 brings (Ice Caves, Frostbite, Freezing), why your current world won't get them without new terrain and how to prepare your server.