-
Notifications
You must be signed in to change notification settings - Fork 1
Enviromental Damage format
You would specify effects by adding nodes to DamageModifiers in config:
DamageModifiers:
FALL:
...
LAVA:
...
You can see all types of damages here.
You enter actions (what happens when player gets hit by specified damage) in similar way than the loot config.
DamageModifiers:
FALL:
- setDamage:
amount: 5
- multiplyDamage:
amount: 5
- addDamage:
amount: 1
- addPotionEffect:
id: 2
duration: 200
amplifier: 1
ambient: true
I hope first 3 nodes are self explanatory, here is some explanations for last one:
id: Id of the potion effect, you can get it here.
duration: duration in ticks (20 means 1 second).
amplifier: Effect level minus 1. So if you want level 3, enter 2.
ambinent: Quote from bukkit wiki: "Makes potion effect produce more, translucent, particles. "
Of course as with loot tables, you can also use chances, picks and groups.
When damage is set to 0, player will still be damaged (hearths will blink, he will "shake" and hear damage sound), just for 0 hearths. You can avoid that by setting damage to -1.
You can also specify duration and amplifier that is relative to the damage (for example let potion effect last 2x longer if damage done is 2x bigger). You can do that simply by entering an expression:
- addPotionEffect:
id: 1
duration: "damage * 60"
amplifier: 20
ambient: false
In above example, potion will last 60 times damage done to the player ticks. You can check all possible operations here (only mathematical part, ignore everyhing else).
Also useful are max and min functions. Max will return biggest number of provided ones and Min will return smallest one. For example min(10,20) will return 10. This is useful for limiting size of the output. For example:
amplifier: "min(max(damage * 60, 20),60)"
Above example will set amplifier to damage * 60, but it will never go lower than 20 or higher than 60.