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
| Field | Type | Default | Description |
|---|---|---|---|
modifier | Attribute Modifier | optional | A single modifier applied to the damage amount. |
modifiers | Array of Attribute Modifier | optional | Several modifiers, applied in operation order. |
target_used | Boolean | false | false changes damage the entity deals, and true changes damage it takes. The two aliases fill this in. |
damage_condition | Damage Condition | optional | Only applies to damage that passes this condition. |
bientity_condition | Bi-Entity Condition | optional | Only 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_condition | Entity Condition | optional | Only 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_action | Bi-Entity Action | optional | Runs 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_action | Entity Action | optional | Runs on the entity with the power every time the power applies. |
target_action | Entity Action | optional | For damage dealt only (target_used: false). Runs on the entity being hit. |
attacker_action | Entity Action | optional | For damage taken only (target_used: true). Runs on the attacker, when there is one. |
apply_armor_condition | Entity Condition | optional | For damage taken only. Armor only reduces the hit while the entity passes this condition, and when it fails, the hit ignores armor. |
damage_armor_condition | Entity Condition | optional | For 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.
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 }
}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.