forked from nisovin/MagicSpells
Potion Effect Spell
JasperLorelai edited this page May 19, 2024
·
15 revisions
spell-class: ".targeted.PotionEffectSpell"
Value | Supported |
---|---|
entity |
true |
location |
false |
entity_from_location |
false |
A targeted spell that applies a potion effect to a target or the caster.
Since 4.0 Beta 13 some of these options support dynamic values through numeric or string expressions.
Option | Description | Type | Default | Supports expressions |
---|---|---|---|---|
targeted |
By default this spell targets the caster. Set to true to make it target the targeted entity. | Boolean | false |
true |
override |
Override existing effect type. | Boolean | false |
true |
spell-power-affects-duration |
Whether spell power should affect the duration. | Boolean | true |
false |
spell-power-affects-strength |
Whether spell power should affect the potion strength. | Boolean | true |
false |
In this variant only one potion effect can be applied.
Option | Description | Type | Default | Supports expressions |
---|---|---|---|---|
type |
The type of potion to use. List of potion effects can be found here | String | "speed" |
true |
duration |
How long, in ticks, to apply the potion effect for. | Integer | 0 |
true |
strength |
The level of potion to apply. This starts at 0, meaning strength: 0 will give a level 1 potion effect. strength: 1 will apply level 2, and so on. |
Integer | 0 |
true |
hidden |
Makes the potion swirls invisible if turned on. | Boolean | false |
true |
ambient |
Makes the potion swirls more translucent if turned on. | Boolean | false |
true |
Example:
Potion:
spell-class: ".targeted.PotionEffectSpell"
type: speed
duration: 80
strength: 1
can-target: caster
ambient: false
hidden: true
Since 4.0 Beta 12 you can alternatively provide a list of potion effects. They can either be listed in:
This form does not support Beta 13's dynamic values (expressions).
<effect> <duration> <strength> <ambient> <hidden> <icon>
Where:
-
effect
is the potion effect -
duration
should be an integer number defining duration in server ticks -
ambient
should be a boolean -
hidden
should be a boolean -
icon
should be a boolean
Example:
test:
spell-class: ".targeted.PotionEffectSpell"
potion-effects:
#- <effect> <duration> <strength> <ambient> <hidden> <icon>
- speed 100 4 false false true
Similarly, you can list a config section, compact or not, supporting multiple potion effects. Since 4.0 Beta 13 these options support dynamic values through numeric or string expressions.
test:
spell-class: ".targeted.PotionEffectSpell"
potion-effects:
# Flow style section
- {type: speed, duration: 100, strength: 4, ambient: false, hidden: false, icon: true}
# Block style section
- type: speed
duration: 100
strength: 4
ambient: false
hidden: false
icon: true