Minecraft Wiki
Advertisement
Para el comando, véase Comandos/attribute.

Los atributos son un sistema de potenciadores/despotenciadores (buffs/debuffs) que actuan como propiedades en criaturas y jugadores. Los atributos también tienen modificadores que ajustan la fuerza de su efecto.

Aplicando atributos[]

Cuando se aplica a un objeto, un modificador ajustará el atributo correspondiente si el objeto es sostenido o está deteriorado[1][2]. Los atributos o modificadores se pueden añadir a los objetos o criaturas, sin el uso de software de edición de NBT de terceros, añadiendo etiquetas de datos (data tags) a los comandos /give (dar) y /summon (invocar).

El siguiente comando le dará al jugador más cercano una espada de diamante que hace 20♥ × 10 de daño extra. Si se cambia "Operation" de 0 a 1, en cambio, se multiplicará el daño de ataque.

/give @p diamond_sword 1 0 {AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:20,Operation:0,UUIDLeast:894654,UUIDMost:2872}]}

El siguiente comando invocará a un zombie que sigue a los jugadores cuando están 100 bloques o menos de él en lugar de los habituales 40.

/summon Zombie ~ ~ ~ {Attributes:[{Name:"generic.followRange",Base:100.0}]}

En la snapshot 15w35b ahora se puede especificar qué ranura tiene ciertos atributos.

/give @p diamond_axe 1 0 {AttributeModifiers:[{Slot:"mainhand",AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:20,Operation:0,UUIDLeast:1,UUIDMost:1}]}

Las ranuras pueden ser "mainhand" (mano principal), "offhand" (mano secundaria), "head" (cabeza), "torso", "legs" (piernas) o "feet" (pies) (pueden ser más).

Además, en caso de que el jugador quiera la velocidad de ataque de 1.8 con el estilo de 1.9, intente esto:

/give @s shield{Unbreakable:1,AttributeModifiers:[{Slot:"offhand", AttributeName:"generic.attack_speed", Name:"generic.attack_speed", Amount:1000.0, Operation:0, UUID:[I; -110663, 103297, -1423577, 206238]}]} 1

A partir de 1.16, el jugador también puede usar el comando /attribute para aplicar atributos. Este ejemplo de comando hace que el atributo Luck (suerte) sea lo suficientemente alto como para pescar tesoros casi siempre:

/attribute @p minecraft:generic.luck base set 1024

Atributos[]

Un atributo individual controla una propiedad, descrita por su name (nombre). Un atributo siempre tiene un valor base, y puede tener cualquier número de modifiers (modificadores). Los atributos también tienen un valor por defecto (se utiliza cuando se genera una criatura con una base de atributo no definido), y el valor no modificable mínimo y máximo. Los modificadores actúan sobre la base de un atributo, pero el valor calculado siempre tiene un tope por el mínimo y el máximo.

El mínimo y el máximo son inclusivos a menos que se especifique lo contrario o que son iguales a 1.7x10308.

Tenga en cuenta que los modificadores de atributo que tienen el mismo UUID y afectan el mismo atributo no se apilan; solo el que afectó más recientemente a un jugador o criatura tiene un efecto, anulando los modificadores que afectaban anteriormente.

Atributos disponibles para toda criatura viviente[]

Estos atributos se encuentran en todos las criaturas, incluyendo a los jugadores.

Nombre de atributo Descripción Base por defecto Mínimo Máximo
generic.max_health La máxima salud de esta criatura (en medios corazones); determina el máximo de salud que pueden ser curadas. Si el jugador está usando esto para invocar a una criatura con mucha salud, usa esto y la etiqueta de salud {Health:200.0f} por ejemplo. (Desactivado en 1.17) 20.0 0.0 1024.0
generic.follow_range El rango en bloques de distancia en el que una criatura con este atributo tomará como objetivo a los jugadores u otras criaturas para perseguirlos. Salir de este rango hará que la criatura cese de ir tras el jugador o criatura. El valor real utilizado por la mayoría de las criaturas es 16; para zombis es 40. 32.0 0.0 2048.0
generic.knockback_resistance La escala de retroceso horizontal resistido de ataques y proyectiles. El retroceso vertical no es afectado. No afecta las explosiones.[3] 1.0 es 100% de resistencia al retroceso. 0.4 significa que se aplica el 60% del retroceso. 0.0 0.0 1.0
generic.movement_speed La velocidad del movimiento en alguna métrica desconocida. Velocidad máxima de la criatura en bloques por segundo es un poco más de 43 veces este valor, pero puede verse afectado por diversas condiciones, tales como: ser montado (si es un caballo), correr, huyendo (si es una criatura pasiva), atacar (si un Enderman o Piglin zombificado), siendo guiado por una correa, estar bajo el efecto de una poción de velocidad o lentitud, siendo un bebé zombi, o siendo una bruja y beber una poción.
Mob generic.movementSpeed
Panda (perezoso) 0.07
Jugador 0.1
Panda, Jugador (corriendo) 0.15
Caballo random value between 0.1125 and 0.3375
Burro, Llama, Mula, Lavagante 0.175
Slime 0.2 + 0.1 * Size
Vaca, Cubo de magma, Mooshroom, Loro, Caballo esqueleto, Gólem de nieve, Caballo zombi 0.2
Blaze, Ahogado, Zombi desértico, Oveja, Zombi, Aldeano zombi,

Piglin zombificado

0.23
Pollo, Creeper, Endermite, Gólem de hierro, Cerdo, Oso polar, Pez plateado, Esqueleto, Stray, Tortuga, Bruja, Esqueleto del Wither 0.25
Abeja, Gato, Araña de cueva, Guardián anciano, Enderman, Zorro, Ocelote, Conejo, Ravager, Araña, Lobo 0.3
Saqueador, Vindicador 0.35
Hoglin 0.4
Evocador, Gigante, Guardián, Ilusionista, Piglin, Aldeano, Vendedor ambulante 0.5
Wither 0.6
Murciélago, Bacalao, Enderdragón, Ghast, Pez globo, Salmón, Shulker, Calamar, Pez tropical, Vex 0.7
Delfín 1.2
0.7 0.0 1024.0
generic.attack_damage Daño causado por ataques, en medio corazón. Este atributo no se encuentra en criaturas y gólems pasivos. 2.0 0.0 2048.0
generic.armor Puntos de defensa de armadura. 0.0 0.0 30.0
generic.armor_toughness Dureza de la armadura. 0.0 0.0 20.0
generic.attack_knockback El retroceso aplicado a los ataques. Se aplica solo a criaturas con ataques físicos.[4]
Ravager: 1.5
Hoglin y Zoglin: 1.0
0.0 0.0 5.0


Atributos para jugadores[]

Estos atributos se utilizan solamente por jugadores.

Nombre de atributo Descripción Base por defecto Mínimo Máximo
generic.attackSpeed Determina la velocidad a la que la fuerza de ataque se recarga. El valor es el número de ataques a fuerza completa por segundo. 4.0 0.0 1024.0
generic.luck Afecta a los resultados de las tablas del botín utilizando la etiqueta quality o bonus_rolls (por ejemplo, al abrir cofres o vagonetas con cofre, la pesca, y matando criaturas) 0.0 -1024.0 1024.0

Atributos para caballos[]

Estos atributos sólo son utilizados por caballos.

Nombre de atributo Descripción Base por defecto Mínimo Máximo
horse.jumpStrength La fuerza de salto del caballo en alguna métrica desconocida. 0.7 0.0 2.0

Atributos para abejas y loros[]

Estos atributos aplican para abejas y loros.

Nombre de atributo Descripción Base por defecto Mínimo Máximo
generic.flying_speed Modificador de velocidad de vuelo en alguna métrica desconocida. Se establece en 0.6 para las abejas y 0.4 para los loros. 0.4 0.0 1024.0

Atributos para zombis[]

Estos atributos sólo son utilizados por zombis.

Nombre de atributo Descripción Base por defecto Mínimo Máximo
zombie.spawnReinforcements La probabilidad de que un zombi se genere otro zombie cuando es atacado. 0.0 0.0 1.0

Propiedades de los atributos desconocidos[]

Cuando el juego se encuentra con un atributo con un nombre no reconocido, aplica estas propiedades al mismo.

Nombre de atributo Descripción Base por defecto Mínimo Máximo
Cualquier nombre de atributo que no es de vanilla. Desconocido 0.0 -1.8×10308 (Negative Double.MAX_VALUE) 1.8×10308 (Double.MAX_VALUE)

Modificadores[]

Los modificadores actúan sobre el valor base de un atributo, aumentando o disminuyendo el mismo. Hay que tener en cuenta que el valor resultante después de la modificación tiene un tope por el mínimo y el máximo del atributo. Al igual que los atributos, los modificadores tienen un name (nombre), sin embargo, este nombre no define el comportamiento del modificador. En cambio, el comportamiento de un modificador está determinado por su operation (operación). Los modificadores también llevan una amount (cantidad) para su modificación, y un UUID para identificar de forma única el modificador.

Operaciones[]

A modifier's operation dictates how it modifies an attribute's base value. Three operations exist:

add (amount +/-): Saved as operation 0. Adds all of the modifiers' amounts to the current value of the attribute. For example, modifying an attribute with {Amount:2,Operation:0} and {Amount:4,Operation:0} with a Base of 3 results in 9 (3 + 2 + 4 = 9).

multiply_base (amount % +/-, additive): Saved as operation 1. Multiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts. For example, modifying an attribute with {Amount:2,Operation:1} and {Amount:4,Operation:1} with a Base of 3 results in 21 (3 * (1 + 2 + 4) = 21).

multiply (amount % +/-, multiplicative): Saved as operation 2. For every modifier, multiplies the current value of the attribute by (1 + x), where x is the amount of the particular modifier. Functions the same as Operation 1 if there is only a single modifier with operation 1 or 2. However, for multiple modifiers it multiplies the modifiers rather than adding them. For example, modifying an attribute with {Amount:2,Operation:2} and {Amount:4,Operation:2} with a Base of 3 results in 45 (3 * (1 + 2) * (1 + 4) = 45).[5]

The mathematical behavior is as follows:

  • add: Increment X by Amount
  • multiply_base: Increment Y by X * Amount
  • multiply: Y = Y * (1 + Amount) (equivalent to Increment Y by Y * Amount).

The game first sets X = Base, then executes all Operation add, then sets Y = X, then executes all multiply_base modifiers, and finally executes all multiply modifiers.

Modificadores de Vanilla[]

Como se presentó antes, el nombre de un modificador puede ser cualquier cosa, y esto no afectará a su comportamiento. Lo siguiente sólo son los nombres de modificadores que se conocen y los valores utilizados en Minecraft Vanilla (no agregar modificadores a esta tabla si se encuentran en mapas personalizados, ya que los creadores de mapas pueden crear sus propios modificadores personalizados). Hay que tener en cuenta que algunos UUID se generan sobre la marcha, mientras que otros son representados como cadenas fijas en el código, éstos también se han enumerado. No hay que agregar UUID a esta tabla para los modificadores en los que no se enumeran, si un UUID no aparece, esto significa que es diferente cada vez que se crea el modificador.

Modifier Name Description and Known Values Known Attributes Modified
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 1; all mobs), Knockback Resistance (Operation 0; Villagers and Zombies only)
Tool modifier Value varies based on tool and tier. generic.attack_damage (Operation 0; tridents, shovels, pickaxes, axes, hoes; UUID CB3F55D3-645C-4F38-A497-9C13A33DB5CF), generic.attack_speed (Operation 0; tridents, shovels, pickaxes, axes, hoes; UUID FA233E1C-4180-4865-B01B-BCCE9785ACA3)
Weapon modifier Value varies based on weapon tier. generic.attack_damage (Operation 0; swords; UUID CB3F55D3-645C-4F38-A497-9C13A33DB5CF), generic.attack_speed (Operation 0; swords; UUID FA233E1C-4180-4865-B01B-BCCE9785ACA3) (same UUIDs as Tool modifier)
Armor modifier Value varies based on slot and tier. generic.armor (Operation 0; boots - UUID 845DB27C-C624-495F-8C9F-6020A9A58B6B, leggings - UUID D8499B04-0E66-4726-AB29-64469D734E0D, chestplate - UUID 9F3D476D-C118-4544-8365-64846904B48E, helmet - UUID 2AD3F246-FEE1-4E67-B886-69FD380BB150)
Armor toughness Value varies based on tier. generic.armor_toughness (Operation 0; boots - UUID 845DB27C-C624-495F-8C9F-6020A9A58B6B, leggings - UUID D8499B04-0E66-4726-AB29-64469D734E0D, chestplate - UUID 9F3D476D-C118-4544-8365-64846904B48E, helmet - UUID 2AD3F246-FEE1-4E67-B886-69FD380BB150)
Sprinting speed boost Fixed value of 0.3 used by all mobs (including players) when sprinting. generic.movement_speed (Operation 2; all living entities; UUID 662A6B8D-DA3E-4C1C-8813-96EA6097278D)
Fleeing speed boost Fixed value of 2 used by all passive mobs when fleeing. generic.movement_speed (Operation 2; all passive mobs; UUID E199AD21-BA8A-4C53-8D13-6182D5C69D3A)
Attacking speed boost Fixed value of 6.2 for Endermen and 0.45 for Zombie Pigmen; exists only when attacking. generic.movement_speed (Operation 0; Endermen - UUID 020E0DFB-87AE-4653-9556-831010E291A0, Zombified Piglins - UUID 49455A49-7EC5-45BA-B886-3B90B23A1718)
Covered armor bonus Fixed value of 20.0 for Shulker exists only when fully closed. generic.armor (Operation 0; Shulker; UUID 7E0292F2-9434-48D5-A29F-9583AF7DF27F)
Horse armor bonus Value varies based on the armor of the horse (None = 0; Iron = 5; Gold = 7;Diamond = 11) generic.armor (Operation 0; EntityHorse; 556E1665-8B10-40C8-8F9D-CF9B1667F295)
Baby speed boost Fixed value of 0.5; exists only for baby Zombies and baby Zombie Villagers. generic.movement_speed (Operation 1; Baby Zombies; UUID B9766B59-9566-4402-BC1F-2EE2A276D836)
Drinking speed penalty Fixed value of -0.25 for Witches when drinking a potion. generic.movement_speed (Operation 0; Witches; UUID 5CD17E52-A79A-43D3-A529-90FDE04B181E)
Random zombie-spawn bonus Generated upon spawning; a random number between 0.0 and 1.5. generic.follow_range (Operation 2; Zombies)
Leader zombie bonus 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 0; Zombies), generic.maxHealth (Operation 2; Zombies)
Zombie reinforcement caller charge Fixed value of -0.05 created each time a zombie spawns another zombie as reinforcement. zombie.spawn_reinforcements (Operation 0; Zombies)
Zombie reinforcement callee charge Fixed value of -0.05 created for each zombie spawned as a reinforcement. zombie.spawn_reinforcements (Operation 0; Zombies)
effect.moveSpeed or effect.moveSpeed # (where # is the potion's amplifier) Fixed value of 0.2 when under the Speed effect, multiplied by the effect's level (amplifier + 1). generic.movement_speed (Operation 2; All living entities; UUID 91AEAA56-376B-4498-935B-2F7F68070635)
effect.moveSlowdown or effect.moveSlowdown # (where # is the potion's amplifier) Fixed value of -0.15 when under the Slowness effect, multiplied by the effect's level. generic.movement_speed (Operation 2; All living entities; UUID 7107DE5E-7CE8-4030-940E-514C1F160890)
effect.digSpeed or effect.digSpeed# (where # is the potion's amplifier) Fixed value of 0.1 when under the Haste effect, multiplied by the effect's level. generic.attack_speed (Operation 2; All living entities; UUID AF8B6E3F-3328-4C0A-AA36-5BA2BB9DBEF3)
effect.digSlowDown or effect.digSlowDown# (where # is the potion's amplifier) Fixed value of -0.1 when under the Mining fatigue effect, multiplied by the effect's level. generic.attack_speed (Operation 2; All living entities; UUID 55FCED67-E92A-486E-9800-B47F202C4386)
effect.damageBoost or effect.damageBoost # (where # is the potion's amplifier) Fixed value of 3 when under the Strength effect, multiplied by the effect's level. generic.attack_damage (Operation 0; All living entities; UUID 648D7064-6A60-4F59-8ABE-C2C23A6DD7A9)
effect.weakness or effect.weakness # (where # is the potion's amplifier) Fixed value of -4 when under the Weakness effect, multiplied by the effect's level. generic.attack_damage (Operation 0; All living entities; UUID 22653B89-116E-49DC-9B6B-9971489B5BE5)
effect.healthBoost # (where # is the potion's amplifier. May be 0.) Fixed value of 4 when under the Health Boost effect, multiplied by the effect's level. generic.max_health (Operation 0; All living entities; UUID 5D6F0BA2-1186-46AC-B896-C61C5CEE99CC)
effect.luck or effect.luck# (where # is the potion's amplifier) Fixed value of 1 when under the Luck effect, multiplied by the effect's level. generic.luck(Operation 0; All living entities; UUID 03C3C89D-7037-4B42-869F-B146BCB64D2E)
effect.unluck or effect.unluck # (where # is the potion's amplifier) Fixed value of -1 when under the Unluck effect, multiplied by the effect's level. generic.luck(Operation 0; All living entities; UUID CC5AF142-2BD2-4215-B636-2605AED11727)
Unknown synced attribute modifier Unknown; created when client reads attribute data sent by server. varies

Historial[]

Java Edition
1.6.113w16aSe han añadido atributos y modificadores.
Existían los siguientes atributos: "Max Health", "Follow Range", "Knockback Resistance"; Además, "Jump Strength" y "Speed" existían como atributos específicos del caballo.
Los únicos modificadores fueron ambos. "Random spawn bonus", uno usado en zombis para derribar la resistencia con operation 0, Y el otro en todas las criaturas para seguir el rango con operation 1.
13w17aSe ha añadido el atributo "Spawn Reinforcements Chance" para zombis.
Se ha añadido "Zombie reinforcement charge" (para generar refuerzos de carga), "Random zombie-spawn bonus" (para seguir el rango) y "Leader zombie bonus" (tanto para la carga de refuerzos como para la salud máxima).
13w18aSe ha reemplazado "Zombie reinforcement charge" con "Zombie reinforcement caller charge"
13w21aLos atributos ahora se pueden especificar en NBT.
Los atributos ahora tienen ID y claves de traducción correspondientes.
Los modificadores ahora se muestran en los objetos.
Se ha añadido "Attack Damage" e hizo genérico "Speed".
Se han añadido los modificadores "potion.moveSpeed", "potion.moveSlowdown", "potion.damageBoost" y "potion.weakness".
Se han añadido "Sprinting speed boost", "Fleeing speed bonus", "Attacking speed boost" (tanto para los hombres cerdos zombies como para los endermans), "Drinking speed penalty" y "Baby speed boost".
Se ha añadido "Tool modifier" y "Weapon modifier".
13w23bSe ha añadido el modificador "potion.healthBoost".
1.7.213w36aAtributos/modificadores se puede agregar a objetos o criaturas sin el uso de software de edición NBT de terceros agregando etiquetas de datos a los comandos /give y /summon.
1.915w34bSe ha añadido el atributo de velocidad de ataque.
15w36dSe ha añadido el atributo de armadura.
15w44bSe ha añadido el atributo de suerte.
1.9.1pre1Se ha añadido el atributo de dureza de armadura.
1.1418w43aSe ha añadido el atributo attackKnockback.
1.1620w06aLa resistencia al retroceso es ahora una escala en lugar de una probabilidad.
20w14aLos objetos y las entidades ya no conservan atributos desconocidos.
Los nombres de algunos atributos se han renombrado para cumplir los requisitos de ubicación del recurso (Por ejemplo: minúsculas separadas por guiones bajos en lugar de mayúsculas y minúsculas).
Se ha renombrado generic.maxHealth to generic.max_health.
Se ha renombrado zombie.spawnReinforcements to zombie.spawn_reinforcements.
Se ha renombrado horse.jumpStrength to horse.jump_strength.
Se ha renombrado generic.followRange to generic.follow_range.
Se ha renombrado generic.knockbackResistance to generic.knockback_resistance.
Se ha renombrado generic.movementSpeed to generic.movement_speed.
Se ha renombrado generic.flyingSpeed to generic.flying_speed.
Se ha renombrado generic.attackDamage to generic.attack_damage
Se ha renombrado generic.attackKnockback to generic.attack_knockback
Se ha renombrado generic.attackSpeed to generic.attack_speed
Se ha renombrado generic.armorToughness to generic.armor_toughness.
20w17aSe ha añadido el comando /attribute, que puede consultar y cambiar atributos.
Próxima Java Edition
Combat Tests1.14.3 - Combat TestSe ha añadido el atributo AttackReach.
Pocket Edition Alpha
v0.12.1build 1Se han añadido los atributos.

Referencias[]

Advertisement