Class EnchantmentHelper

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

public abstract class EnchantmentHelper extends Object
An enchantment helper class to retrieve correct Minecraft enchantments object across versions.
Version:
3.3.1
Author:
Andross
  • Method Details

    • getEnchantment

      @Nullable public static @Nullable org.bukkit.enchantments.Enchantment getEnchantment(@NotNull @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 @Nullable EnchantmentWrapper getEnchantmentWrapper(@NotNull @NotNull String enchant)
      Try to get an EnchantmentWrapper from a string which syntax must be 'enchantment:level'.
      Parameters:
      enchant - the string
      Returns:
      an EnchantmentWrapper if valid, otherwise null
    • getAllEnchantmentWrappers

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

      @NotNull public static @NotNull List<String> getEnchantmentsNames()
      Get the list of enchantments name based on the Minecraft version used.
      Returns:
      list of enchantments name based on the Minecraft version used.