Skip to main content

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

FieldTypeDefaultDescription
classIdentifierrequiredThe 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.
attributeIdentifierrequiredThe attribute to take the modifiers from, such as minecraft:generic.movement_speed. An unknown attribute is a load error.
multiplierFloat1Scales each transferred modifier. 0.5 passes on half of every bonus, and a negative number turns bonuses into penalties.

Classes

classWhat the modifiers change
modify_air_speedMovement while in the air, as Modify Air Speed
modify_swim_speedHow much momentum the entity keeps in water, as Modify Swim Speed
modify_jumpJump strength, as Modify Jump
modify_slipperinessThe friction of the block the entity stands on, as Modify Slipperiness
modify_velocityMovement on all three axes, as Modify Velocity
modify_fallingGravity while falling, as Modify Falling
modify_break_speedMining speed (not block hardness), as Modify Break Speed
modify_exhaustionHunger exhaustion, as Modify Exhaustion
modify_healingEvery heal, as Modify Healing
modify_damage_dealtDamage the entity deals, as Modify Damage with target_used: false
modify_damage_takenDamage the entity takes, as Modify Damage with target_used: true
modify_projectile_damageDamage from the entity's projectiles, as Modify Projectile Damage
modify_status_effect_amplifierThe amplifier of every effect the entity receives, as Modify Status Effect Amplifier
modify_status_effect_durationThe duration of every effect the entity receives, as Modify Status Effect Duration
modify_fovThe 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:

  1. add_value modifiers are added to the value.
  2. add_multiplied_base modifiers are added together and multiply the result once.
  3. Each add_multiplied_total modifier 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_speed transfer speeds up every block, a modify_status_effect_duration transfer lengthens every effect, and a modify_velocity transfer acts on all three axes.
  • The power's own condition turns it on and off as usual.
note

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.