How to create your own effect

Create your own class for your effect and make it extends Effect

Then edit the name, description, and usage and make sure you remove variables from the class method and only leave the plugin variable.

public class Test extends Effect{
    public Test(Plugin plugin) {
        super(plugin, "TEST", "This is a test", "TEST:[VALUE]");
    }

    @Override
    public void init() {
        registerEvent(BlockBreakEvent.class, event -> {
            Player player = event.getPlayer();

            if (!hasEffect(player, getName())) return;

            for (String[] argument : getArguments(player, getName())) {
                String value = argument[1];

                Bukkit.broadcastMessage(value);
            }
        });
    }
}

Create your effect in the class and once you are finished add this to your onEnable but make sure EliteArmor is a dependency and is loaded.

EliteArmorAPI.getArmorAPI().loadEffects(Test.class);

Last updated