属性

提供: Minecraft Wiki
Attributeから転送)
移動先: 案内検索
Book and Quill.png
この記事の内容は翻訳されていません。
あなたが内容を翻訳してみませんか?

Attributes are a system of buffs/debuffs which are properties on mobs and players. Attributes also have modifiers which adjust the strength of their effect.

属性の適用[編集 | ソースを編集]

アイテムに属性を適用させることで、所持または装備中に対応する属性が調整される。[1][2] give/summonコマンドにデータタグを追加することで、他製のNBT編集ソフトウェアを使用せずに属性/変更をアイテムやMobに追加できる。

次のコマンドは、20♥ × 10ダメージを与えるダイヤの剣を最も近いプレイヤー与えるコマンドである。Operationの項目を0から1にすると、攻撃ダメージが掛け算される(例:Amountの値が10のとき、Operationが0であれば「攻撃力+10」、1であれば「攻撃力+1000%」、つまり10倍となる)。

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

次のコマンドは、プレイヤーを追跡する範囲を通常の40マスから100マスに変更したゾンビを召喚するコマンドである。

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

また、どのスロットに特定の属性があるかを指定することができる。

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

スロットには、利き手(メインハンド)、オフハンド、頭、胴体、脚、足がある。

属性[編集 | ソースを編集]

個々の属性がいくつかの性質を制御しており、その名前で内容を説明している。属性は必ず基本値を持ち、いくつかの効果を加える。属性には、デフォルト値(属性の基本値が未定義のままMobを召喚する時に使用される)とハードコードされた最小値と最大値がある。属性の基本値に従って効果は作用するが、値は必ず最小値と最大値の範囲内である。

最小値と最大値は、特に指定のない場合やそれらが1.7x10308に等しい場合含まれる。

同じUUIDをもち、同じ属性に影響を与える属性の効果は上乗せされない。直前に与えた効果を上書きして、最後にプレイヤーやMobに影響を与えた効果だけ残る。

Mob の属性[編集 | ソースを編集]

以下は、プレイヤー、動物、モンスター等の Mob に使用できる属性の一覧である。

属性名 属性の効果 デフォルトの数値 最小の数値 最大の数値
generic.maxHealth Mob の最大体力。数値2でハート1個分と同じになる。 20.0 0.0 1024.0
generic.followRange 特定の Mob に対して敵対する Mob が、敵を見つけることが出来る範囲。ほとんどの Mob でのこの数値は13である。 32.0 0.0 2048.0
generic.knockbackResistance ダメージを受けたときに起こるノックバックを軽減する。 0.0 0.0 1.0
generic.movementSpeed Mob の移動速度。Mob の移動速度は以下の通りだが、プレイヤーが乗ったり(ウマに乗るなど)、他の Mob から逃げたり、ステータス効果などによって移動速度は変化する。
Mob デフォルトの数値 1秒で進む距離
プレイヤー 0.1 4.3m/s
ダッシュ時のプレイヤー 0.15 6.5m/s
ウマ 0.1125~0.3375 の間(ランダム) 4.85m/s〜14.55m/s の間

(ランダム)

ラマ 0.175 7.5m/s
ウシ, ムーシュルーム, スノウゴーレム 0.2 8.6m/s
村人ゾンビ, ブレイズ, ヒツジ, ハスク, ゾンビ, ゾンビピッグマン 0.23 9.9m/s
クリーパー, シロクマ, アイアンゴーレム, ストレイ, エンダーマイト, ウィッチ, ニワトリ, シルバーフィッシュ, スケルトン, ブタ, ウィザースケルトン 0.25 10.8m/s
エンダーマン, エルダーガーディアン, 洞窟グモ, ウサギ, 殺人ウサギ, ヤマネコ, クモ, オオカミ 0.3 12.9m/s
ヴィンディケーター 0.35 15.1m/s
マグマキューブ, スライム 0.4 17.2m/s
村人, ジャイアント, ガーディアン, エヴォーカー 0.5 21.6m/s
ウィザー 0.6 25.9m/s
エンダードラゴン, コウモリ, ガスト, シュルカー, イカ, ヴェックス 0.7 30.2m/s
0.7* 0.0 1024.0
generic.attackDamage Mob の攻撃力。数値2でハート1個分のダメージとなる。 2.0 0.0 2048.0
generic.armor 防具の防御力。数値20でダイヤフル装備と同じになる。 0.0 0.0 30.0
generic.armorToughness 防具の耐久力。 0.0 0.0 20.0

Attributes for players[編集 | ソースを編集]

These attributes are only used by players.

Attribute Name Description Default Base Minimum Maximum
generic.attackSpeed Determines speed at which attack strength recharges. Value is the number of full-strength attacks per second. 4.0 0.0 1024.0
generic.luck Affects the results of loot tables using the quality or bonus_rolls tag (e.g. when opening chests or chest minecarts, fishing, and killing mobs). 0.0 -1024.0 1024.0

Attributes for horses[編集 | ソースを編集]

These Attributes are only used by Horses.

Attribute Name Description Default Base Minimum Maximum
horse.jumpStrength Horse jump strength in some unknown metric. 0.7* 0.0 2

Attributes for zombies[編集 | ソースを編集]

These Attributes are only used by zombies.

Attribute Name Description Default Base Minimum Maximum
zombie.spawnReinforcements Chance that a zombie will spawn another zombie when attacked. 0.0 0.0 1.0

Properties of unknown attributes[編集 | ソースを編集]

When the game finds an attribute with an unrecognized name, it applies these properties to it. (WARNING! The line of code that does this causes minecraft to crash)

Attribute Name Description Default Base Minimum Maximum
Any non-Vanilla Attribute name Unknown. 0.0 0 1.7x10308

Modifiers[編集 | ソースを編集]

Modifiers act upon the base value of an attribute, increasing or decreasing it. Note that the resulting value after modification is capped by the attribute's minimum and maximum. Like attributes, modifiers have a name, however, this name 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, and a UUID (Universally Unique IDentifier).

Operations[編集 | ソースを編集]

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

Operation 0: Additive. 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).

Operation 1: Multiplicative. 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).

Operation 2: Multiplicative. 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 will multiply 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).[3]

The mathematical behavior is as follows: Operation 0: Increment X by Amount, Operation 1: Increment Y by X * Amount, Operation 2: Y = Y * (1 + Amount) (equivalent to Increment Y by Y * Amount). The game first sets X = Base, then executes all Operation 0 modifiers, then sets Y = X, then executes all Operation 1 modifiers, and finally executes all Operation 2 modifiers.

Vanilla modifiers[編集 | ソースを編集]

As stated before, a modifier's name can be anything, and this will not affect its behavior. The following are only known modifier names and values used in vanilla minecraft (do not add modifiers to this table if you find them in custom maps, as map makers may create their own custom modifiers). Note that some UUIDs are generated on-the-fly, while others are represented as fixed strings in the code - these have been listed as well. Do not add UUIDs to this table for modifiers where they are not listed - if a UUID is not listed, this means that it is different every time the modifier is created!

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.followRange (Operation 1; all mobs), Knockback Resistance (Operation 0; Villagers and Zombies only)
Tool modifier Value varies based on tool. generic.attackDamage (Operation 0; all tools; UUID CB3F55D3-645C-4F38-A497-9C13A33DB5CF), generic.attackSpeed (Operation 0; all tools; UUID FA233E1C-4180-4865-B01B-BCCE9785ACA3)
Weapon modifier Value varies based on weapon and weapon tier. generic.attackDamage (Operation 0; all tools; UUID CB3F55D3-645C-4F38-A497-9C13A33DB5CF), generic.attackSpeed (Operation 0; all tools; UUID FA233E1C-4180-4865-B01B-BCCE9785ACA3) (same UUIDs as Tool modifier)
Sprinting speed boost Fixed value of 0.3* used by all mobs (including players) when sprinting. generic.movementSpeed (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.movementSpeed (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.movementSpeed (Operation 0; Endermen - UUID 020E0DFB-87AE-4653-9556-831010E291A0, Zombie Pigmen - 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.movementSpeed (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.movementSpeed (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.followRange (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.maxHealth, random number between 1.0 and 4.0. zombie.spawnReinforcements (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.spawnReinforcements (Operation 0; Zombies)
Zombie reinforcement callee charge Fixed value of -0.05* created for each zombie spawned as a reinforcement. zombie.spawnReinforcements (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.movementSpeed (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.movementSpeed (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.attackSpeed (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.attackSpeed (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.attackDamage (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.attackDamage (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.maxHealth (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

History[編集 | ソースを編集]

Java Edition
1.6.113w16aAdded attributes.
1.7.213w36aAttributes/modifiers can be added to items or mobs without the use of third-party NBT editing software by adding data tags to the give and summon commands.
1.915w34bAdded attack speed attribute.
15w36dAdded armor attribute.
15w44bAdded luck attribute.
1.9.1-pre1Added armorToughness attribute.
Pocket Edition Alpha
0.12.1build 1Added attributes.

References[編集 | ソースを編集]