EpicEnchants/src/main/java/com/craftaro/epicenchants/effect/effects/Burn.java

22 lines
837 B
Java

package com.craftaro.epicenchants.effect.effects;
import com.craftaro.epicenchants.effect.EffectExecutor;
import com.craftaro.epicenchants.enums.EventType;
import com.craftaro.epicenchants.objects.LeveledModifier;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class Burn extends EffectExecutor {
public Burn(ConfigurationSection section) {
super(section);
}
@Override
public void execute(@NotNull Player user, @Nullable LivingEntity opponent, int level, EventType eventType) {
consume(entity -> entity.setFireTicks((int) LeveledModifier.of(getSection().getString("time")).get(level, 20, user, opponent)), user, opponent);
}
}