{{For|the command|Commands/attribute}}
{{exclusive|java}}

An '''attribute''' is a value that determines certain properties of [[mob]]s, [[armor stand]]s, and [[player]]s. Attributes also have modifiers that adjust the strength of their effects.

== Applying attributes ==

Attributes can be applied directly to living entities using the {{cmd|attribute}} command. The below command is an example that increases the luck attribute, leading to the player being able to fish treasures nearly every time:

{{cmd|long=1|attribute @p minecraft:luck base set 1024 }}

Additionally, attribute values can be specified when summoning a mob. For example, the following command summons a zombie that follows players when they are 100 blocks or less from it instead of the usual 40:

{{cmd|long=1|summon zombie ~ ~ ~ {attributes:[{id:"follow_range", base:100.0}]} }}

Attributes can also be applied as attribute modifiers on items by using [[data components]]. When applied to an item, a modifier adjusts the corresponding attribute if the item is held or worn.<ref>{{tweet|dinnerbone|337540303647027201|Good news for mapmakers: Items can have attribute modifiers. It's possible to make a bow that slows the holder, helm that buffs health, etc|May 23, 2013}}</ref><ref>{{tweet|dinnerbone|337543314435878913|Equipped as armour or held in hand.|May 23, 2013}}</ref> Attribute modifiers can be added to items by adding data tags to the item. Each attribute modifier has an unique identifier, which is a [[resource location]] to identify the modifier.

The following command gives the player a netherite sword that deals {{hp|20}} extra damage:

{{cmd|long=1|give @s netherite_sword[attribute_modifiers{{=}}[{type:"attack_damage", amount:20.0, operation:"add_value", id:"example:custom_damage", slot:"mainhand"}]] }}

== Attributes ==
An individual attribute controls some property, described by its ''name''. An attribute always has a ''base'' value, and may have any number of ''modifiers''. Attributes also have a default value (used when spawning a mob with an undefined attribute base), and hard-coded minimum and maximum values. Modifiers act on an attribute's base, but the calculated value is always capped by the minimum and maximum.

Attribute modifiers that have the same ID and affect the same attribute do not stack; only the one that most recently affected a player or mob has an effect, overriding the previously affecting modifier(s).

These attributes are found on all living entities, including players.
<!--
    Note for border-top-color, "--archive-box-border-color" exists only on dark, and falls back to "--content-border-top-color" for light mode.
-->
{| class="wikitable" style="width:100%"
! style="position:sticky; top:0;" | Attribute Name
! style="position:sticky; top:0;" | Default Base
! style="position:sticky; top:0;" | Minimum<br>~<br>Maximum
! style="position:sticky; top:0;" | Description
! style="position:sticky; top:0;" | [[Mob]]
! style="position:sticky; top:0;" | Base Value
|-
| rowspan=4 | {{cd|armor}}
| rowspan=4 | 0
| rowspan=4 | 0~30
| rowspan=4 | Armor defense points.
| {{EntityLink|Killer Bunny}}
| 8
|-
| {{EntityLink|Wither}}
| 4
|-
| {{EntityLink|Zombie}}<br>{{EntityLink|Husk}}<br>{{EntityLink|Drowned}}<br>{{EntityLink|Zombie Villager}}<br>{{EntityLink|Zombified Piglin}}
| 2
|-
| Every other mob
| 0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|armor_toughness}}
| 0
| 0~20
|[[Armor toughness]].
| Every mob
| 0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=12 | {{cd|attack_damage}}
| rowspan=12 | 2
| rowspan=12 | 0~2048
| rowspan=12 | Damage dealt by attacks, in half-hearts.
| {{EntityLink|Giant}}
| 50
|-
| {{EntityLink|Warden}}
| 30
|-
| {{EntityLink|Ravager}}
| 12
|-
| {{EntityLink|Frog}}
| 10
|-
| {{EntityLink|Elder Guardian}}
| 8
|-
| {{EntityLink|Enderman}}<br>{{EntityLink|Piglin Brute}}
| 7
|-
| {{EntityLink|Blaze}}<br>{{EntityLink|Guardian}}<br>{{EntityLink|Hoglin}}<br>{{EntityLink|Panda}}<br>{{EntityLink|Phantom}}<br>{{EntityLink|Polar Bear}}<br>{{EntityLink|Zoglin}}
| 6
|-
| {{EntityLink|Piglin}}<br>{{EntityLink|Pillager}}<br>{{EntityLink|Vindicator}}<br>{{EntityLink|Zombified Piglin}}
| 5
|-
| {{EntityLink|Vex}}
| 4
|-
| {{EntityLink|Cat}}<br>{{EntityLink|Dolphin}}<br>{{EntityLink|Drowned}}<br>{{EntityLink|Husk}}<br>{{EntityLink|Ocelot}}<br>{{EntityLink|Zombie}}<br>{{EntityLink|Zombie Villager}}
| 3
|-
| {{EntityLink|Allay}}<br>{{EntityLink|Axolotl}}<br>{{EntityLink|Bee}}<br>{{EntityLink|Breeze}}<br>{{EntityLink|Cave Spider}}<br>{{EntityLink|Creeper}}<br>{{EntityLink|Endermite}}<br>{{EntityLink|Evoker}}<br>{{EntityLink|Fox}}<br>{{EntityLink|Goat}}<br>{{EntityLink|Illusioner}}<br>{{EntityLink|Magma Cube}}<br>{{EntityLink|Skeleton}}<br>{{EntityLink|Slime}}<br>{{EntityLink|Spider}}<br>{{EntityLink|Stray}}<br>{{EntityLink|Witch}}<br>{{EntityLink|Wither}}<br>{{EntityLink|Wither Skeleton}}<br>{{EntityLink|Wolf}}
| 2
|-
| {{EntityLink|Silverfish}}<br>{{EntityLink|Player}}
| 1
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=3 | {{Cd|attack_knockback}}
| rowspan=3 | 0
| rowspan=3 | 0~5
| rowspan=3 | Knockback applied to attacks. Applies only to mobs with physical attacks.<ref>{{bug|MC-138868}}</ref>
| {{EntityLink|Ravager}}<br>{{EntityLink|Warden}}
| 1.5
|-
| {{EntityLink|Hoglin}}<br>{{EntityLink|Zoglin}}
| 1
|-
| {{EntityLink|Player}}<br>Every other mob
| 0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{cd|generic.attack_reach}}{{upcoming|Java Edition Combat Tests}} 
| 2.5
| 0~6
| Determines the reach at which players can attack entities. Does not affect interaction range.
| {{EntityLink|Player}}
| 2.5
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|attack_speed}}
| 4
| 0~1024
| Determines recharging rate of attack strength. Value is the number of full-strength attacks per second.
| {{EntityLink|Player}}
| 4
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=3 | {{Cd|flying_speed}}
| rowspan=3 | 0.4
| rowspan=3 | 0~1024
| rowspan=3 | Flight speed modifier in some unknown metric.
| {{EntityLink|Bee}}<br>{{EntityLink|Wither}}
| 0.6
|-
| {{EntityLink|Parrot}}
| 0.4
|-
| {{EntityLink|Allay}}
| 0.1
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=11 | {{Cd|follow_range}}
| rowspan=11 | 32
| rowspan=11 | 0~2048
| rowspan=11 | The range in blocks within which a mob with this attribute targets players or other mobs to track. Exiting this range causes the mob to cease following the player/mob. Actual value used by most mobs is 16; for zombies it is 35.
| {{EntityLink|Ghast}}
| 100
|-
| {{EntityLink|Enderman}}
| 64
|-
| {{EntityLink|Allay}}<br>{{EntityLink|Bee}}<br>{{EntityLink|Blaze}}<br>{{EntityLink|Villager}}
| 48
|-
| {{EntityLink|Llama}}<br>{{EntityLink|Wither}}
| 40
|-
| {{EntityLink|Zombie}}<br>{{EntityLink|Husk}}<br>{{EntityLink|Drowned}}<br>{{EntityLink|Zombie Villager}}<br>{{EntityLink|Zombified Piglin}}
| 35
|-
| {{EntityLink|Fox}}<br>{{EntityLink|Pillager}}<br>{{EntityLink|Ravager}}
| 32
|-
| {{EntityLink|Breeze}}
| 24
|-
| {{EntityLink|Polar Bear}}
| 20
|-
| {{EntityLink|Illusioner}}
| 18
|-
| {{EntityLink|Evoker}}<br>{{EntityLink|Vindicator}}
| 12
|-
| Every other mob
| 16
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=4 | {{Cd|knockback_resistance}}
| rowspan=4 | 0
| rowspan=4 | 0~1
| rowspan=4 | The scale of horizontal knockback resisted from attacks and projectiles. Vertical knockback is not affected. Does not affect explosions.<ref>{{bug|MC-32578}}</ref> The resistance functions as a percentage from 0.0 (0% resistance) to 1.0 (100% resistance) (e.g. 0.4 is 40% resistance, meaning the attributed mob takes 60% of usual knockback). Iron golems and wardens suffer zero knockback from attacks or projectiles.
| {{EntityLink|Iron Golem}}<br>{{EntityLink|Warden}}
| 1
|-
| {{EntityLink|Ravager}}
| 0.75
|-
| {{EntityLink|Hoglin}}<br>{{EntityLink|Zoglin}}
| 0.6
|-
| Every other mob
| 0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|luck}}
| 0
| -1024~1024
| Affects the results of [[loot tables]] using the {{cd|quality}} or {{cd|bonus_rolls}} tag (e.g. when opening chests or chest minecarts, fishing, and killing mobs).
| {{EntityLink|Player}}
| 0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|max_absorption}}
| 0
| 0~2048
| The maximum [[absorption]] of this mob (in half-hearts); determines the highest health they may gain by the Absorption effect.
| Every mob
| 0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|max_health}}
| 20
| 1~1024
| The maximum [[health]] of this mob (in half-hearts); determines the highest health they may be healed to. If the player is using this to summon a mob with high health, use this and the Health tag <code>{Health:200.0f}</code> for example. (Disabled in 1.17)
| Every mob
| The maximum health of the mob
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=18 | {{Cd|movement_speed}}
| rowspan=18 | 0.7
| rowspan=18 | 0~1024
| rowspan=18 | Movement speed is the speed at which entities can move, but this is not the actual speed value in blocks/second. The mob's actual speed in blocks/second is a bit over 20 times this value, but is affected by various conditions, such as the behavior it's following (e.g. idling, attacking or fleeing), being ridden (if a horse), sprinting, being led by a leash, and being under the effect of a Speed or Slowness potion. Baby mobs also have an additional speed multiplier on top of the base value.
| {{EntityLink|Dolphin}}
| 1.2
|-
| {{EntityLink|Axolotl}}<br>{{EntityLink|Frog}}<br>{{EntityLink|Tadpole}}
| 1
|-
| {{EntityLink|Armor Stand}}<br>{{EntityLink|Bat}}<br>{{EntityLink|Cod}}<br>{{EntityLink|Ender Dragon}}<br>{{EntityLink|Ghast}}<br>{{EntityLink|Glow Squid}}<br>{{EntityLink|Phantom}}<br>{{EntityLink|Pufferfish}}<br>{{EntityLink|Salmon}}<br>{{EntityLink|Shulker}}<br>{{EntityLink|Squid}}<br>{{EntityLink|Tropical Fish}}<br>{{EntityLink|Vex}}<br>{{EntityLink|Wandering Trader}}
| 0.7
|-
| {{EntityLink|Breeze}}<br>{{EntityLink|Wither}}
| 0.6
|-
| {{EntityLink|Evoker}}<br>{{EntityLink|Giant}}<br>{{EntityLink|Guardian}}<br>{{EntityLink|Illusioner}}<br>{{EntityLink|Villager}}
| 0.5
|-
| {{EntityLink|Piglin}}<br>{{EntityLink|Piglin Brute}}<br>{{EntityLink|Pillager}}<br>{{EntityLink|Vindicator}}
| 0.35
|-
| {{EntityLink|Bee}}<br>{{EntityLink|Cat}}<br>{{EntityLink|Cave Spider}}<br>
{{EntityLink|Creaking}}<br>
{{EntityLink|Elder Guardian}}<br>{{EntityLink|Enderman}}<br>{{EntityLink|Fox}}<br>{{EntityLink|Hoglin}}<br>{{EntityLink|Ocelot}}<br>{{EntityLink|Rabbit}}<br>{{EntityLink|Ravager}}<br>{{EntityLink|Spider}}<br>{{EntityLink|Warden}}<br>{{EntityLink|Wolf}}<br>{{EntityLink|Zoglin}}
| 0.3
|-
| {{EntityLink|Chicken}}<br>{{EntityLink|Creeper}}<br>{{EntityLink|Endermite}}<br>{{EntityLink|Iron Golem}}<br>{{EntityLink|Pig}}<br>{{EntityLink|Polar Bear}}<br>{{EntityLink|Silverfish}}<br>{{EntityLink|Skeleton}}<br>{{EntityLink|Stray}}<br>{{EntityLink|Turtle}}<br>{{EntityLink|Witch}}<br>{{EntityLink|Wither Skeleton}}
| 0.25
|-
| {{EntityLink|Blaze}}<br>{{EntityLink|Drowned}}<br>{{EntityLink|Husk}}<br>{{EntityLink|Sheep}}<br>{{EntityLink|Zombie}}<br>{{EntityLink|Zombie Villager}}<br>{{EntityLink|Zombified Piglin}}
| 0.23
|-
| {{EntityLink|Horse}}
| 0.1125 and 0.3375<br>Random value
|-
| {{EntityLink|Magma Cube}}<br>{{EntityLink|Slime}}
| 0.3 + 0.1 × Size
|-
| {{EntityLink|Cow}}<br>{{EntityLink|Goat}}<br>{{EntityLink|Mooshroom}}<br>{{EntityLink|Parrot}}<br>{{EntityLink|Skeleton Horse}}<br>{{EntityLink|Snow Golem}}<br>{{EntityLink|Zombie Horse}}
| 0.2
|-
| {{EntityLink|Donkey}}<br>{{EntityLink|Llama}}<br>{{EntityLink|Mule}}<br>{{EntityLink|Strider}}<br>{{EntityLink|Trader Llama}}
| 0.175
|-
| {{EntityLink|Panda}}
| 0.15
|-
| {{EntityLink|Armadillo}}
| 0.14
|-
| {{EntityLink|Allay}}<br>{{EntityLink|Player}}<br>{{EntityLink|Sniffer}}
| 0.1
|-
| {{EntityLink|Camel}}
| 0.09
|-
| {{EntityLink|id=lazy-panda|Panda}}（lazy）
| 0.07
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|scale}}
| 1
| 0.0625~16
| The multiplier of the size of an entity.	
| Every mob
| 1
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=4 | {{Cd|step_height}}
| rowspan=4 | 0.6
| rowspan=4 | 0~10
| rowspan=4 | The maximum number of blocks that an entity can step up without jumping. [[Sneaking]] prevents drops from heights that are higher than this attribute.<ref>{{bug|MC-268917}}</ref> This happens if the height that the player is above a block is equal or less than the attribute.
| {{EntityLink|Axolotl}}<br>{{EntityLink|Donkey}}<br>{{EntityLink|Drowned}}<br>{{EntityLink|Enderman}}<br>{{EntityLink|Frog}}<br>{{EntityLink|Horse}}<br>{{EntityLink|Iron Golem}}<br>{{EntityLink|Llama}}<br>{{EntityLink|Mule}}<br>{{EntityLink|Ravager}}<br>{{EntityLink|Skeleton Horse}}<br>{{EntityLink|Trader Llama}}<br>{{EntityLink|Turtle}}<br>{{EntityLink|Zombie Horse}}
| 1
|-
| {{EntityLink|Camel}}
| 1.5
|-
| Every other mob
| 0.6
|-
| {{EntityLink|Armor Stand}}
| 0<ref>{{bug|MC-133544}}</ref>
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| rowspan=3 | {{Cd|jump_strength}}
| rowspan=3 | 0.42{{note|Actual value is 0.41999998688697815}}
| rowspan=3 | 0~32
| rowspan=3 | The initial vertical velocity of an entity when they jump, in blocks per tick.
| Every mob
| 0.4-1<br>Random value
|-
| Every other mob
| 0.42
|-
| {{EntityLink|Donkey}}<br>{{EntityLink|Mule}}<br>{{EntityLink|Llama}}<br>{{EntityLink|Trader Llama}}
| 0.175
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|block_interaction_range}}
| 4.5
| 0~64
| The [[Player#Reach|block interaction range]] for players in blocks.
| {{EntityLink|Player}}
| 4.5{{note|name=creative_mode|1=In [[Creative]] mode, the block interaction range is increased by 0.5 and the entity interaction range by 2 to make some actions easier. This does not affect the base value of the attribute, so the bonus acts as a modifier.}}
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|entity_interaction_range}}
| 3
| 0~64
| The [[Player#Reach|entity interaction range]] for players in blocks.
| {{EntityLink|Player}}
| 3{{note|name=creative_mode}}
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
| {{Cd|spawn_reinforcements}}
| 0
| 0~1
| Chance for a zombie to spawn another zombie when attacked.	
| {{EntityLink|Zombie}}<br>{{EntityLink|Husk}}<br>{{EntityLink|Drowned}}<br>{{EntityLink|Zombie Villager}}<br>{{EntityLink|Zombified Piglin}}
| 0~0.1<br>Random value
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|block_break_speed}}
|1
|0~1024
|The speed the player can break blocks as a multiplier.
|{{EntityLink|Player}}
|1
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|gravity}}
|0.08
| -1~1
|The gravity affecting an entity in blocks per tick squared.
|Every mob
|0.08
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|rowspan=3|{{Cd|safe_fall_distance}}
|rowspan=3|3
|rowspan=3| -1024~1024
|rowspan=3|The number of blocks an entity can fall before fall damage starts to be accumulated. Also the minimum amount of blocks the entity has to fall to make fallling particles and sounds.
|{{EntityLink|Fox}}
|5
|-
|{{EntityLink|Camel}}<br>{{EntityLink|Donkey}}<br>{{EntityLink|Horse}}<br>{{EntityLink|Llama}}<br>{{EntityLink|Mule}}<br>{{EntityLink|Skeleton Horse}}<br>{{EntityLink|Trader Llama}}<br>{{EntityLink|Zombie Horse}}
|6
|-
|Every other mob
|3
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|rowspan=2|{{Cd|fall_damage_multiplier}}
|rowspan=2|1
|rowspan=2|0~100
|rowspan=2|The amount of fall damage an entity takes as a multiplier.
|{{EntityLink|Camel}}<br>{{EntityLink|Donkey}}<br>{{EntityLink|Horse}}<br>{{EntityLink|Llama}}<br>{{EntityLink|Mule}}<br>{{EntityLink|Skeleton Horse}}<br>{{EntityLink|Trader Llama}}<br>{{EntityLink|Zombie Horse}}
|0.5
|-
|Every other mob
|1
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|burning_time}}
|1
|0~1024
|Amount of time how long an entity remains on fire after being ignited as a multiplier. A value of 0 eliminates the burn time. Has no impact on the burning time increase when staying in fire.
|Every mob
|1
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|explosion_knockback_resistance}}
|0
|0~1
|Defines what percentage of knockback an entity resists. A value of 1 eliminates the knockback.
|Every mob
|0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|mining_efficiency}}
|0
|0~1024
|A factor to speed up the mining of blocks when using the right tool.
|{{EntityLink|Player}}
|0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|movement_efficiency}}
|0
|0~1
|A factor to improve walking on terrain that slows down movement. A value of 1 removes the slowing down.
|Every mob
|0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|oxygen_bonus}}
|0
|0~1024
|Determines the chance that an entity's {{cd|Air}} data tag decreases in any given game tick, while the entity is underwater. The chance is given by {{cd|1 / (oxygen_bonus +1)}}.
|Every mob
|0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|sneaking_speed}}
|0.3
|0~1
|The movement speed factor when sneaking or crawling. A factor of 1 means sneaking or crawling is as fast as walking, a factor of 0 means unable to move while sneaking or crawling.
|{{EntityLink|Player}}
|0.3
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|submerged_mining_speed}}
|0.2
|0~20
|The mining speed factor when underwater. A factor of 1 means mining as fast as on land, a factor of 0 means unable to mine while submerged. This represents only the submersion factor itself; other factors (such as not touching the ground) also apply.
|{{EntityLink|Player}}
|0.2
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{cd|sweeping_damage_ratio}}
|0
|0~1
|Determines how much of the base attack damage gets transferred to secondary targets in a sweep attack. This is in addition to the base attack of the sweep damage itself. A value of 1 means that all of the base attack damage is transferred (sweep damage is attack_damage + 1)
|{{EntityLink|Player}}
|0
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{cd|tempt_range}}
|10
|0~2048
|Determines the range, in blocks, at which temptable mobs can be tempted.
|{{EntityLink|Armadillo}}<br>{{EntityLink|Axolotl}}<br>{{EntityLink|Bee}}<br>{{EntityLink|Camel}}<br>{{EntityLink|Cat}}<br>{{EntityLink|Chicken}}<br>{{EntityLink|Cow}}<br>{{EntityLink|Donkey}}<br>{{EntityLink|Fox}}<br>{{EntityLink|Frog}}<br>{{EntityLink|Goat}}<br>{{EntityLink|Horse}}<br>{{EntityLink|Llama}}<br>{{EntityLink|Mooshroom}}<br>{{EntityLink|Mule}}<br>{{EntityLink|Ocelot}}<br>{{EntityLink|Panda}}<br>{{EntityLink|Parrot}}<br>{{EntityLink|Pig}}<br>{{EntityLink|Polar Bear}}<br>{{EntityLink|Rabbit}}<br>{{EntityLink|Sheep}}<br>{{EntityLink|Skeleton Horse}}<br>{{EntityLink|Sniffer}}<br>{{EntityLink|Strider}}<br>{{EntityLink|Tadpole}}<br>{{EntityLink|Trader Llama}}<br>{{EntityLink|Turtle}}<br>{{EntityLink|Wolf}}<br>{{EntityLink|Zombie Horse}}<br>
|10
|- style="border-top: solid; border-top-color: var(--archive-box-border-color, var(--content-border-top-color));"
|{{Cd|water_movement_efficiency}}
|0
|0~1
|The movement speed factor when submerged. A higher value lets entities move faster. This represents only the submersion factor itself; other factors (such as not touching the ground) also apply.
|Every mob
|0
|}

== Modifiers ==

Modifiers act upon the base value of an attribute, increasing or decreasing it. The resulting value after modification is capped by the attribute's minimum and maximum. Similar to attribute names, modifiers have an ''ID'', a [[resource location]] to uniquely identify the modifier. However, this ID does not define the modifier's behavior. Instead, a modifier's behavior is determined by its ''operation''. Modifiers also carry an ''amount'' to their modification. When attribute modifiers are applied to items, the ''type'' parameter is required; this defines which attribute the modifier affects. Modifiers can be added or removed from all living entities using the {{Cmd|attribute}} command or modifying the entity's [[Entity format|NBT data]]. Modifiers can be added or removed from items using [[data components]].

=== Operations ===

Modifier operations dictate how it modifies an attribute base value. There are three operations that exist<ref>{{tweet|dinnerbone|337542071386783744|Attribute modifiers can be: +- amount, +- amount % (additive), +- amount % (multiplicative).|May 23, 2013}}</ref>:

{|class="wikitable"
|-
! Operation !! Description
|-
| '''add_value''' (+- amount)
| Adds all of the modifiers' amounts to the base attribute.

<math>\text{Total} = \text{Base} + \text{Amount}_1 + \text{Amount}_2 + \ldots + \text{Amount}_n</math>

For example, applying two '''add_value''' modifiers with amounts of 2 and 4, to attribute base of 3:

<math>\text{Total} = 3 + 2 + 4 = 9</math>
|-
| '''add_multiplied_base''' (+- amount, additive)
| Multiplies the base attribute by (1 + sum of modifiers' amounts).

<math>\text{Total} = \text{Base} \times (1 + \text{Amount}_1 + \text{Amount}_2 + \ldots + \text{Amount}_n)</math>

For example, applying two '''add_multiplied_base''' modifiers with amounts of 2 and 4, to attribute base of 3:

<math>\text{Total} = 3 \times (1 + 2 + 4) = 3 \times 7 = 21</math>
|-
| '''add_multiplied_total''' (+- amount, multiplicative)
| Multiplies the base attribute by (1 + modifiers' amounts) for every modifier.

<math>\text{Total} = \text{Base} \times (1 + \text{Amount}_1) \times (1 + \text{Amount}_2) \times \ldots \times (1 + \text{Amount}_n)</math>

For example, applying two '''add_multiplied_total''' modifiers with amounts of 2 and 4, to attribute base of 3:

<math>\text{Total} = 3 \times (1 + 2) \times (1 + 4) = 3 \times 3 \times 5 = 45</math>
|}

If multiple attribute modifiers are applied, then the game first executes all '''add_value''' modifiers, then carries the ''Total'' value as the ''Base'' for the next modifiers, which is '''add_multiplied_base''', and then finally '''add_multiplied_total'''.

=== Vanilla modifiers ===
As stated before, a modifier's ID can be anything, and this does not affect its behavior. The following are known modifier names and values used in vanilla Minecraft. Some entries have "none/unknown" IDs–these are vanilla modifiers with hardcoded values and an unclear namespace ID. Modifiers with labeled "none/unknown", along with base attack damage and base attack speed, do not appear in [[NBT format|NBT data]]. Manually setting vanilla modifiers with the correct ID and attribute overrides the default value.

{| class="wikitable" style="width:100%" data-description="Modifiers"
! style="position:sticky; top:0;" | Modifier
! style="position:sticky; top:0;" | Modifier ID
! style="position:sticky; top:0;" | Description and Known Values
! style="position:sticky; top:0;" | Known Attributes Modified
|-
| Random spawn bonus
|minecraft:random_spawn_bonus
| Generated upon spawning; a random number from a Gaussian distribution ranging from 0.0 to 0.05. For Zombie Knockback Resistance, another value between 0.0 and 0.05 is also generated.
| generic.follow_range (Operation {{cd|add_multiplied_base}}; all mobs), Knockback Resistance (Operation {{cd|add_value}}; [[Zombie]]<nowiki/>s only)
|-
|Base attack damage
|minecraft:base_attack_damage
|Value varies based on tool/weapon and tier.
|generic.attack_damage (Operation {{cd|add_value}}; tridents, shovels, pickaxes, axes, hoes, maces)
|-
|Base attack speed
|minecraft:base_attack_speed
|Value varies based on tool/weapon and tier.
|generic.attack_speed (Operation {{cd|add_value}}; tridents, shovels, pickaxes, axes, hoes, maces)
|-
| Armor modifier
|minecraft:armor.helmet
minecraft:armor.chestplate

minecraft:armor.leggings

minecraft:armor.boots
| Value varies based on slot and tier.
| generic.armor (Operation {{cd|add_value}}; boots, leggings, chestplate, helmet, turtle shell)
|-
| Armor toughness
|minecraft:armor.helmet
minecraft:armor.chestplate

minecraft:armor.leggings

minecraft:armor.boots
| Value varies based on tier.
| generic.armor_toughness (Operation {{cd|add_value}}; boots, leggings, chestplate, helmet, turtle shell)
|-
| Armor knockback resistance
|minecraft:armor.helmet
minecraft:armor.chestplate

minecraft:armor.leggings

minecraft:armor.boots
| Applies knockback resistance similarily to netherite armor. A piece of netherite armor is equivalent to {{cd|add_value}} with amount 0.1.
| generic.knockback_resistance (Operation {{cd|add_value}}; boots, leggings, chestplate, helmet)
|-
| Sprinting speed boost
|None/unknown
| Fixed value of 0.3 used by all mobs (including players) when sprinting.
| generic.movement_speed (Operation {{cd|add_multiplied_total}}; all living entities)
|-
| Fleeing speed boost
|None/unknown
| Fixed value of 2.0 used by all passive mobs when fleeing.
| generic.movement_speed (Operation {{cd|add_multiplied_total}}; all passive mobs)
|-
| Attacking speed boost
|None/unknown
| Fixed value of 6.2 for Endermen and 0.45 for zombie pigmen; exists only when attacking.
| generic.movement_speed (Operation {{cd|add_value}}; [[Endermen]], [[Zombified Piglin]]<nowiki/>s)
|-
| Covered
|minecraft:covered
| Fixed value of 20.0 for shulker exists only when fully closed.
| generic.armor (Operation {{cd|add_value}}; [[Shulker]]<nowiki/>s)
|-
| Horse armor bonus
|minecraft:armor.body
| Value varies based on the armor of the horse.
| generic.armor (Operation {{cd|add_value}}; [[Horse]]<nowiki/>s), generic.armor_toughness (Operation {{cd|add_value}}; [[Horse]]<nowiki/>s)
|-
|Wolf armor bonus
|minecraft:armor.body
|Fixed value of 11.0 for wolves wearing [[Wolf Armor|wolf armor]].
|generic.armor (Operation {{cd|add_value}}; [[Wolve]]<nowiki/>s)
|-
| Baby speed boost
|None/unknown
| Fixed value of 0.5; exists only for baby zombies and baby zombie villagers.
| generic.movement_speed (Operation {{cd|add_multiplied_base}}; [[Baby Zombie]]<nowiki/>s. [[Baby villager]]<nowiki/>s)
|-
| Drinking speed penalty
|None/unknown
| Fixed value of -0.25 for Witches when drinking a potion.
| generic.movement_speed (Operation {{cd|add_value}}; [[Witch]]<nowiki/>es)
|-
| Random zombie-spawn bonus
|None/unknown
| Generated upon spawning; a random number between 0.0 and 1.5.
| generic.follow_range (Operation {{cd|add_multiplied_total}}; [[Zombie]]<nowiki/>s)
|-
| Leader zombie bonus
|None/unknown
| Has a (small) random chance of being generated on a zombie when spawned. For Spawn Reinforcements Chance, random number between 0.5 and 0.75. For generic.max_health, random number between 1.0 and 4.0.
| zombie.spawn_reinforcements (Operation {{cd|add_value}}; [[Zombie]]<nowiki/>s), generic.maxHealth (Operation {{cd|add_multiplied_total}}; [[Zombie]]<nowiki/>s)
|-
| Zombie reinforcement caller charge
|None/unknown
| Fixed value of -0.05 created each time a zombie spawns another zombie as reinforcement.
| zombie.spawn_reinforcements (Operation {{cd|add_value}}; [[Zombie]]<nowiki/>s)
|-
| Zombie reinforcement callee charge
|None/unknown
| Fixed value of -0.05 created for each zombie spawned as a reinforcement.
| zombie.spawn_reinforcements (Operation {{cd|add_value}}; [[Zombie]]<nowiki/>s)
|-
| Speed effect
|minecraft:effect.speed
| Fixed value of 0.2 when under the Speed effect, multiplied by the effect's ''level'' (amplifier + 1).
| generic.movement_speed (Operation {{cd|add_multiplied_total}}; All living entities)
|-
| Slowness effect
|minecraft:effect.slowness
| Fixed value of -0.15 when under the Slowness effect, multiplied by the effect's level.
| generic.movement_speed (Operation {{cd|add_multiplied_total}}; All living entities)
|-
| Haste effect
|minecraft:effect.haste
| Fixed value of 0.1 when under the Haste effect, multiplied by the effect's level.
| generic.attack_speed (Operation {{cd|add_multiplied_total}}; All living entities)
|-
| Mining fatigue effect
|minecraft:effect.mining_fatigue
| Fixed value of -0.1 when under the Mining fatigue effect, multiplied by the effect's level.
| generic.attack_speed (Operation {{cd|add_multiplied_total}}; All living entities)
|-
| Strength effect
|minecraft:effect.strength
| Fixed value of 3.0 when under the Strength effect, multiplied by the effect's level.
| generic.attack_damage (Operation {{cd|add_value}}; All living entities)
|-
| Weakness effect
|minecraft:effect.weakness
| Fixed value of -4.0 when under the Weakness effect, multiplied by the effect's level.
| generic.attack_damage (Operation {{cd|add_value}}; All living entities)
|-
| Health boost effect
|minecraft:effect.health_boost
| Fixed value of 4.0 when under the Health Boost effect, multiplied by the effect's level.
| generic.max_health (Operation {{cd|add_value}}; All living entities)
|-
| Luck effect
|minecraft:effect.luck
| Fixed value of 1.0 when under the Luck effect, multiplied by the effect's level.
| generic.luck (Operation {{cd|add_value}}; All living entities)
|-
| Unluck effect
|minecraft:effect.unluck
| Fixed value of -1.0 when under the Unluck effect, multiplied by the effect's level.
| generic.luck (Operation {{cd|add_value}}; All living entities)
|-
| Jump boost effect
|minecraft:effect.jump_boost
| Fixed value of 0.21 when under the Jump boost effect, multiplied by the effect's level.
| generic.jump_strength (Operation {{cd|add_multiplied_total}}; All living entities)
|-
| Unknown synced attribute modifier
|None/unknown
| Unknown; created when the client reads attribute data sent by the server.
| varies
|}

== History ==

{{HistoryTable
|{{HistoryLine|java}}
|{{HistoryLine||1.6.1|dev=13w16a|Added attributes and modifiers.|The following attributes existed: "Max Health", "Follow Range", "Knockback Resistance"; furthermore, "Jump Strength" and "Speed" existed as horse-specific attributes.|The only modifiers were both "Random spawn bonus", one used on Zombies to knockback resistance with operation 0, and the other on all mobs to follow range with operation 1.}}
|{{HistoryLine|||dev=13w17a|Added "Spawn Reinforcements Chance" attribute for Zombies.|Added "Zombie reinforcement charge" (to spawn reinforcements charge), "Random zombie-spawn bonus" (to follow range), and "Leader zombie bonus" (to both reinforcements charge and max health).}}
|{{HistoryLine|||dev=13w18a|Replaced "Zombie reinforcement charge" with "Zombie reinforcement caller charge"}}
|{{HistoryLine|||dev=13w21a|Attributes now can be specified in NBT.|Attributes now have IDs and corresponding translation keys.|Modifiers now display on items.|Added "Attack Damage" and made "Speed" generic.|Added "potion.moveSpeed", "potion.moveSlowdown", "potion.damageBoost", and "potion.weakness" modifiers.|Added "Sprinting speed boost", "Fleeing speed bonus", "Attacking speed boost" (for both pigmen and endermen), "Drinking speed penalty", and "Baby speed boost".|Added "Tool modifier" and "Weapon modifier".}}
|{{HistoryLine|||dev=13w23b|Added "potion.healthBoost" modifier.}}
|{{HistoryLine||1.7.2|dev=13w36a|Attributes/modifiers can be added to items or mobs without the use of third-party NBT editing software by adding data tags to the {{cmd|give}} and {{cmd|summon}} commands.}}
|{{HistoryLine||1.9|dev=15w34b|Added attack speed attribute.}}
|{{HistoryLine|||dev=15w36d|Added armor attribute.}}
|{{HistoryLine|||dev=15w44b|Added luck attribute.}}
|{{HistoryLine||1.9.1|dev=pre1|Added armorToughness attribute.}}
|{{HistoryLine||1.12|dev=pre1|Added flyingSpeed attribute.}}
|{{HistoryLine||1.14|dev=18w43a|Added attackKnockback attribute.}}
|{{HistoryLine||1.16|dev=20w06a|Knockback resistance is now a scale rather than probability.}}
|{{HistoryLine|||dev=20w14a|Items and entities no longer keep unknown attributes.
|Names of some attributes have been renamed to meet [[resource location]] requirements (i.e., lowercase separated by underscores instead of camel case).
|Renamed {{cd|generic.maxHealth|d=to|generic.max_health}}.
|Renamed {{cd|zombie.spawnReinforcements|d=to|zombie.spawn_reinforcements}}.
|Renamed {{cd|horse.jumpStrength|d=to|horse.jump_strength}}.
|Renamed {{cd|generic.followRange|d=to|generic.follow_range}}.
|Renamed {{cd|generic.knockbackResistance|d=to|generic.knockback_resistance}}.
|Renamed {{cd|generic.movementSpeed|d=to|generic.movement_speed}}.
|Renamed {{cd|generic.flyingSpeed|d=to|generic.flying_speed}}.
|Renamed {{cd|generic.attackDamage|d=to|generic.attack_damage}}
|Renamed {{cd|generic.attackKnockback|d=to|generic.attack_knockback}}
|Renamed {{cd|generic.attackSpeed|d=to|generic.attack_speed}}
|Renamed {{cd|generic.armorToughness|d=to|generic.armor_toughness}}.}}
|{{HistoryLine|||dev=20w17a|Added the {{cmd|attribute}} command, which can query and change attributes.}}
|{{HistoryLine||1.18.2|dev=22w03a|Knockback resistance no longer gives a 50% chance to ignore all knockback.}}
|{{HistoryLine||1.20.2|dev=23w31a|Added the {{cd|generic.max_absorption}} attribute.}}
|{{HistoryLine||1.20.5|dev=23w51a|Added {{cd|generic.scale}} and {{cd|generic.step_height}} attributes for all living entities, as well as {{cd|generic.block_interaction_range}} and {{cd|generic.entity_interaction_range}} attributes for players.}}
|{{HistoryLine|||dev=24w03a|Renamed {{cd|generic.block_interaction_range}} and {{cd|generic.entity_interaction_range}} to {{cd|player.block_interaction_range}} and {{cd|player.entity_interaction_range}}.}}
|{{HistoryLine|||dev=24w06a|Added {{cd|generic.gravity}}, {{cd|generic.safe_fall_distance}}, {{cd|generic.fall_damage_multiplier}} and {{cd|player.block_break_speed}} attributes.|Renamed {{cd|horse.jump_strength}} to {{cd|generic.jump_strength}}.}}
|{{HistoryLine||1.21|dev=24w18a|Added {{cd|generic.burning_time}}, {{cd|generic.explosion_knockback_resistance}}, {{cd|player.mining_efficiency}}, {{cd|generic.movement_efficiency}}, {{cd|generic.oxygen_bonus}}, {{cd|player.sneaking_speed}}, {{cd|player.submerged_mining_speed}}, {{cd|player.sweeping_damage_ratio}}and {{cd|generic.water_movement_efficiency}} attributes.|{{cd|generic.attack_knockback}} attribute now also works for players.}}
|{{HistoryLine|||dev=24w21a|The {{cd|uuid}} and {{cd|name}} arguments have been replaced with a singular {{cd|id}} argument.}}
|{{HistoryLine||1.21.2|dev=24w33a|Added the {{cd|tempt_range}} attribute.
|Removed the {{cd|generic.}}, {{cd|player.}}, or {{cd|zombie.}} prefixes from all the attributes. Instead of using the resource locations, the argument instead just asks for the name of the attribute.}}
|{{HistoryLine||1.21.4|dev=24w44a|Players can no longer sprint while sneaking or crawling when having the {{cd|sneaking_speed}} attribute set to 0.8 or higher.<ref>{{bug|MC-278349}}</ref>}}
|{{HistoryLine|upcoming java}}
|{{HistoryLine||Combat Tests|dev=1.14.3 - Combat Test|Added {{cd|generic.attackReach}} attribute.}}
|{{HistoryLine|||dev=Combat Test 6|Renamed {{cd|generic.attackReach|d=to|generic.attack_reach}}.}}
|{{HistoryLine|pocket alpha}}
|{{HistoryLine||v0.12.1|dev=build 1|Added attributes.}}
|{{HistoryLine|console}}
|{{HistoryLine||xbox=TU19|xbone=CU7|ps3=1.12|psvita=1.12|ps4=1.12|wiiu=Patch 1|switch=1.0.1|Added attributes.}}
|{{HistoryLine||xbox=TU36|xbone=CU25|ps3=1.28|psvita=1.28|ps4=1.28|wiiu=Patch 7|switch=1.0.1|Attributes of items are shown above the [[HUD]] when switching items in the hotbar if the item has less than 3 enchantments.}}
|{{HistoryLine||xbox=TU46|xbone=CU36|ps3=1.38|psvita=1.38|ps4=1.38|wiiu=Patch 15|switch=1.0.1|Added armor and luck attributes.}}
|{{HistoryLine||xbox=TU54|xbone=CU44|ps3=1.52|psvita=1.52|ps4=1.52|wiiu=Patch 24|switch=1.0.4|Added flying speed attribute.{{verify|May be possible to use through modding/world editing.}}}}

}}

== References ==
{{reflist}}

== Notes ==
{{notelist}}

== Navigation ==
{{Navbox gameplay}}

[[de:Attribut]]
[[es:Atributo]]
[[fr:Attribut]]
[[ja:属性]]
[[ko:속성]]
[[pl:Atrybuty]]
[[pt:Atributo]]
[[zh:属性]]
