Class EnchantmentWrapper

java.lang.Object
org.bukkit.enchantments.Enchantment
org.bukkit.enchantments.EnchantmentWrapper
All Implemented Interfaces:
net.kyori.adventure.key.Keyed, Translatable, Keyed

@Deprecated public abstract class EnchantmentWrapper extends Enchantment
Deprecated.
only for backwards compatibility, EnchantmentWrapper is no longer used.
A simple wrapper for ease of selecting Enchantments
  • Constructor Details

    • EnchantmentWrapper

      protected EnchantmentWrapper()
      Deprecated.
  • Method Details

    • getEnchantment

      @NotNull public @NotNull Enchantment getEnchantment()
      Deprecated.
      Gets the enchantment bound to this wrapper
      Returns:
      Enchantment
    • displayName

      @NotNull public Component displayName(int level)
      Deprecated.
      Description copied from class: Enchantment
      Get the name of the enchantment with its applied level.

      If the given level is either less than the Enchantment.getStartLevel() or greater than the Enchantment.getMaxLevel(), the level may not be shown in the numeral format one may otherwise expect.

      Specified by:
      displayName in class Enchantment
      Parameters:
      level - the level of the enchantment to show
      Returns:
      the name of the enchantment with level applied
    • translationKey

      @NotNull public @NotNull String translationKey()
      Deprecated.
      Description copied from interface: net.kyori.adventure.translation.Translatable
      Gets the translation key.
      Returns:
      the translation key
    • isTradeable

      public boolean isTradeable()
      Deprecated.
      Description copied from class: Enchantment
      Checks if this enchantment can be found in villager trades.
      Specified by:
      isTradeable in class Enchantment
      Returns:
      true if the enchantment can be found in trades
    • isDiscoverable

      public boolean isDiscoverable()
      Deprecated.
      Description copied from class: Enchantment
      Checks if this enchantment can be found in an enchanting table or use to enchant items generated by loot tables.
      Specified by:
      isDiscoverable in class Enchantment
      Returns:
      true if the enchantment can be found in a table or by loot tables
    • getMinModifiedCost

      public int getMinModifiedCost(int level)
      Deprecated.
      Description copied from class: Enchantment
      Gets the minimum modified cost of this enchantment at a specific level.

      Note this is not the number of experience levels needed, and does not directly translate to the levels shown in an enchanting table. This value is used in combination with factors such as tool enchantability to determine a final cost. See https://minecraft.wiki/w/Enchanting/Levels for more information.

      Specified by:
      getMinModifiedCost in class Enchantment
      Parameters:
      level - The level of the enchantment
      Returns:
      The modified cost of this enchantment
    • getMaxModifiedCost

      public int getMaxModifiedCost(int level)
      Deprecated.
      Description copied from class: Enchantment
      Gets the maximum modified cost of this enchantment at a specific level.

      Note this is not the number of experience levels needed, and does not directly translate to the levels shown in an enchanting table. This value is used in combination with factors such as tool enchantability to determine a final cost. See https://minecraft.wiki/w/Enchanting/Levels for more information.

      Specified by:
      getMaxModifiedCost in class Enchantment
      Parameters:
      level - The level of the enchantment
      Returns:
      The modified cost of this enchantment
    • getRarity

      @NotNull public EnchantmentRarity getRarity()
      Deprecated.
      Description copied from class: Enchantment
      Gets the rarity of this enchantment.
      Specified by:
      getRarity in class Enchantment
      Returns:
      the rarity
    • getDamageIncrease

      public float getDamageIncrease(int level, @NotNull EntityCategory entityCategory)
      Deprecated.
      Description copied from class: Enchantment
      Gets the damage increase as a result of the level and entity category specified
      Specified by:
      getDamageIncrease in class Enchantment
      Parameters:
      level - the level of enchantment
      entityCategory - the category of entity
      Returns:
      the damage increase
    • getActiveSlots

      @NotNull public Set<EquipmentSlot> getActiveSlots()
      Deprecated.
      Description copied from class: Enchantment
      Gets the equipment slots where this enchantment is considered "active".
      Specified by:
      getActiveSlots in class Enchantment
      Returns:
      the equipment slots