Attribute Modify Transfer (Power Type)
Applies the modifiers on one of the entity's attributes to a value that another power type changes. The Avian's Like Air uses it, so everything that makes the Avian walk faster (Speed, sprinting, its own tailwind) also makes it faster in the air.
Type ID: apoli:attribute_modify_transfer
Fields
| Field | Type | Default | Description |
|---|---|---|---|
class | Identifier | required | The power type whose value receives the modifiers. A bare name such as modify_air_speed means apoli:modify_air_speed, and the origins: namespace works too. See Classes. |
attribute | Identifier | required | The attribute to take the modifiers from, such as minecraft:generic.movement_speed. An unknown attribute is a load error. |
multiplier | Float | 1 | Scales each transferred modifier. 0.5 passes on half of every bonus, and a negative number turns bonuses into penalties. |
Classes
class | What the modifiers change |
|---|---|
modify_air_speed | Movement while in the air, as Modify Air Speed |
modify_swim_speed | How much momentum the entity keeps in water, as Modify Swim Speed |
modify_jump | Jump strength, as Modify Jump |
modify_slipperiness | The friction of the block the entity stands on, as Modify Slipperiness |
modify_velocity | Movement on all three axes, as Modify Velocity |
modify_falling | Gravity while falling, as Modify Falling |
modify_break_speed | Mining speed (not block hardness), as Modify Break Speed |
modify_exhaustion | Hunger exhaustion, as Modify Exhaustion |
modify_healing | Every heal, as Modify Healing |
modify_damage_dealt | Damage the entity deals, as Modify Damage with target_used: false |
modify_damage_taken | Damage the entity takes, as Modify Damage with target_used: true |
modify_projectile_damage | Damage from the entity's projectiles, as Modify Projectile Damage |
modify_status_effect_amplifier | The amplifier of every effect the entity receives, as Modify Status Effect Amplifier |
modify_status_effect_duration | The duration of every effect the entity receives, as Modify Status Effect Duration |
modify_fov | The field of view, as Modify FOV |
Any other power type, modify_damage itself included, is a load error that lists these classes.
How the modifiers are applied
The transfer reads every modifier on the attribute, whatever added it, and applies them the way the attribute does:
add_valuemodifiers are added to the value.add_multiplied_basemodifiers are added together and multiply the result once.- Each
add_multiplied_totalmodifier multiplies the result in turn.
multiplier scales each modifier's amount first. The transferred modifiers join the class's own powers in the usual operation order, so a set_total from a modify_air_speed power still has the last word.
- The transfer works even when the entity has no power of that class itself.
- It ignores the class's filters. A
modify_break_speedtransfer speeds up every block, amodify_status_effect_durationtransfer lengthens every effect, and amodify_velocitytransfer acts on all three axes. - The power's own
conditionturns it on and off as usual.
The modifiers are added up once, when something changes them on the attribute, and the result is stored with the attribute. A transfer costs about as much per tick as one more modifier on the class's power.
Examples
{
"type": "apoli:attribute_modify_transfer",
"class": "modify_air_speed",
"attribute": "minecraft:generic.movement_speed",
"multiplier": 1
}Every bonus to walking speed also applies in the air. This is the Avian's Like Air.
{
"type": "apoli:attribute_modify_transfer",
"class": "modify_jump",
"attribute": "minecraft:generic.movement_speed",
"multiplier": 0.5,
"condition": {
"type": "apoli:sprinting"
}
}While sprinting, half of each walking speed bonus also strengthens the jump. With Speed II (+40%) and the sprint bonus (+30%), the jump is 1.2 × 1.15 times as strong.