Making a simple effect
Effects inherit the CustomEffect
interface. They work in a similar way as CustomItem
. You only need to overwrite one method that tells the plugin what you are doing.
Of course it uses a date class called CustomEffectData
. It contains the name of the effect, its id, its maximum amplifier (The maximum level can be obtained via getMaxLevel()
) and whether the effect can be cleared by milk or player death.
And we need to register it.
And you are good to go! Use /customitem
command to give your self a effect.
You can check if player have your effect through code via CustomEffectManager#containEffect(Player, CustomEffect)
or CustomEffectManager#getAllPlayerAppliedEffects
Last updated