Skip to main content

Modify Damage (Power Type)

Changes damage. target_used decides which side it applies to, and two aliases fill that field in for you: apoli:modify_damage_dealt sets it to false and apoli:modify_damage_taken sets it to true. The aliases are easier to read, so use them.

Type ID: apoli:modify_damage (aliases apoli:modify_damage_dealt, apoli:modify_damage_taken)

Fields

FieldTypeDefaultDescription
modifierAttribute ModifieroptionalA single modifier applied to the damage amount.
modifiersArray of Attribute ModifieroptionalSeveral modifiers, applied in operation order.
target_usedBooleanfalsefalse changes damage the entity deals, and true changes damage it takes. The two aliases fill this in.
damage_conditionDamage ConditionoptionalOnly applies to damage that passes this condition.
bientity_conditionBi-Entity ConditionoptionalOnly applies for this pairing, with the attacker as the actor and the entity taking the damage as the target. It fails when there is no attacker, such as for falling, fire or /kill.
target_conditionEntity ConditionoptionalOnly applies when the entity taking the damage passes this condition. That is the entity being hit when dealing damage, and the entity with the power when taking it.
bientity_actionBi-Entity ActionoptionalRuns on the attacker (actor) and the entity taking the damage (target) every time the power applies. It is skipped when there is no attacker.
self_actionEntity ActionoptionalRuns on the entity with the power every time the power applies.
target_actionEntity ActionoptionalFor damage dealt only (target_used: false). Runs on the entity being hit.
attacker_actionEntity ActionoptionalFor damage taken only (target_used: true). Runs on the attacker, when there is one.
apply_armor_conditionEntity ConditionoptionalFor damage taken only. Armor only reduces the hit while the entity passes this condition, and when it fails, the hit ignores armor.
damage_armor_conditionEntity ConditionoptionalFor damage taken only. Worn armor only loses durability from the hit while the entity passes this condition.

The actions run once per hit, after the damage is changed, for every one of these powers that applied to the hit.

tip

To see what these powers do to each hit, turn on dev mode. Every hit they change is reported with its damage before and after.

Examples

Hit 50% harder:

{
  "type": "apoli:modify_damage_dealt",
  "modifier": {
    "operation": "multiply_base_multiplicative",
    "value": 0.5
  }
}

Take a quarter less damage, from explosions only:

{
  "type": "apoli:modify_damage_taken",
  "damage_condition": { "type": "apoli:explosive" },
  "modifier": {
    "operation": "multiply_base_multiplicative",
    "value": -0.25
  }
}

Take double damage from one source, the usual way an origin gets a weakness:

{
  "type": "apoli:modify_damage_taken",
  "damage_condition": {
    "type": "apoli:in_tag",
    "tag": "minecraft:is_fire"
  },
  "modifier": {
    "operation": "multiply_base_multiplicative",
    "value": 1.0
  }
}

Hit undead harder, checking the pair of entities instead of the damage:

{
  "type": "apoli:modify_damage_dealt",
  "bientity_condition": {
    "type": "apoli:target_condition",
    "condition": { "type": "apoli:in_tag", "tag": "minecraft:undead" }
  },
  "modifier": { "operation": "multiply_base_multiplicative", "value": 1.0 }
}
tip

multiply_base_multiplicative with -1.0 reduces the damage to zero. That is a softer way to write immunity than apoli:invulnerability, because other powers can still add damage afterwards.