ExcellentEnchants-spigot/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantBunnyHop.java

34 lines
1.2 KiB
Java

package su.nightexpress.excellentenchants.enchantment.impl.armor;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.NotNull;
import su.nightexpress.excellentenchants.ExcellentEnchants;
import su.nightexpress.excellentenchants.api.enchantment.template.PotionEnchant;
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
import su.nightexpress.excellentenchants.api.enchantment.util.EnchantPriority;
public class EnchantBunnyHop extends PotionEnchant implements PassiveEnchant {
public static final String ID = "bunny_hop";
public EnchantBunnyHop(@NotNull ExcellentEnchants plugin) {
super(plugin, ID, EnchantPriority.MEDIUM, PotionEffectType.JUMP, true);
}
@Override
@NotNull
public EnchantmentTarget getItemTarget() {
return EnchantmentTarget.ARMOR_FEET;
}
@Override
public boolean onTrigger(@NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
if (!this.isAvailableToUse(entity)) return false;
return this.addEffect(entity, level);
}
}