Class EnchantmentHelper

java.lang.Object
fr.andross.banitem.utils.enchantments.EnchantmentHelper

public final class EnchantmentHelper extends Object
An enchantment helper class to retrieve correct Bukkit enchantments object across versions
Version:
3.3.1
Author:
Andross
  • Constructor Details

    • EnchantmentHelper

      public EnchantmentHelper()
  • Method Details

    • getEnchantment

      @Nullable public static org.bukkit.enchantments.Enchantment getEnchantment(@NotNull String name)
      Try to get an Enchantment object by the name
      Parameters:
      name - name of the enchantment
      Returns:
      a bukkit enchantment object, null if not found
    • getEnchantmentWrapper

      @Nullable public static EnchantmentWrapper getEnchantmentWrapper(@NotNull String enchant)
      Try to get an EnchantmentWrapper from a string which synthax must be 'enchantment:level'
      Parameters:
      enchant - the string
      Returns:
      an EnchantmentWrapper if valid, otherwise null
    • getAllEnchantmentWrappers

      @NotNull public static List<EnchantmentWrapper> getAllEnchantmentWrappers(@NotNull org.bukkit.enchantments.Enchantment enchantment)
      Get all enchantmentwrappers (all levels) for a bukkit Enchantment
      Parameters:
      enchantment - the bukkit enchantment
      Returns:
      a list which contains all levels
    • getEnchantmentsNames

      @NotNull public static List<String> getEnchantmentsNames()