Class XEnchantment

java.lang.Object
com.cryptomorin.xseries.base.XModule<XEnchantment,org.bukkit.enchantments.Enchantment>
com.cryptomorin.xseries.XEnchantment
All Implemented Interfaces:
XBase<XEnchantment,org.bukkit.enchantments.Enchantment>

public final class XEnchantment extends XModule<XEnchantment,org.bukkit.enchantments.Enchantment>
Enchantment support with multiple aliases. Uses some EssentialsX enchantment list for aliases. Enchantment levels do not start from 0, they start from 1

EssentialsX Enchantment: https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/enchantments/Enchantment.java Enchantment: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html Enchanting: https://minecraft.wiki/w/Enchanting

Version:
3.0.0
Author:
Crypto Morin
See Also:
  • Enchantment
  • Field Details

  • Method Details

    • of

      @NotNull public static @NotNull XEnchantment of(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment)
    • of

      public static Optional<XEnchantment> of(@NotNull @NotNull String enchantment)
    • values

      @NotNull @Deprecated public static @NotNull XEnchantment[] values()
      Deprecated.
    • isSmiteEffectiveAgainst

      @Deprecated public static boolean isSmiteEffectiveAgainst(@Nullable @Nullable org.bukkit.entity.EntityType type)
      Checks if Smite is effective against this type of mob.
      Parameters:
      type - the type of the mob.
      Returns:
      true if smite enchantment is effective against the mob, otherwise false.
      Since:
      1.1.0
    • isArthropodsEffectiveAgainst

      @Deprecated public static boolean isArthropodsEffectiveAgainst(@Nullable @Nullable org.bukkit.entity.EntityType type)
      Checks if Bane of Arthropods is effective against this type of mob.
      Parameters:
      type - the type of the mob.
      Returns:
      true if Bane of Arthropods enchantment is effective against the mob, otherwise false.
      Since:
      1.1.0
    • matchXEnchantment

      @NotNull @Deprecated public static @NotNull Optional<XEnchantment> matchXEnchantment(@NotNull @NotNull String enchantment)
      Deprecated.
      Use of(String) instead.
      Gets an enchantment from Vanilla and bukkit names. There are also some aliases available.
      Parameters:
      enchantment - the name of the enchantment.
      Returns:
      an enchantment.
      Since:
      1.0.0
    • matchXEnchantment

      @NotNull @Deprecated public static @NotNull XEnchantment matchXEnchantment(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment)
      Deprecated.
      Use of(Enchantment) instead.
      Gets an enchantment from Vanilla and bukkit names. There are also some aliases available.
      Parameters:
      enchantment - the enchantment.
      Returns:
      an enchantment.
      Throws:
      IllegalArgumentException - may be thrown as an unexpected exception.
      Since:
      1.0.0
    • getBook

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getBook(int level)
      Gets the enchanted book of this enchantment.
      Parameters:
      level - the level of this enchantment.
      Returns:
      an enchanted book.
      Since:
      1.0.0
    • getEnchant

      @Nullable @Deprecated public @Nullable org.bukkit.enchantments.Enchantment getEnchant()
      Deprecated.
      use XModule.get() instead.
      Parse the Vanilla enchantment.
      Returns:
      a Vanilla enchantment.
      Since:
      1.0.0