Interface EnchantItemEvent.CalculateLevelRequirement

All Superinterfaces:
Cancellable, EnchantItemEvent, Event, InteractContainerEvent
Enclosing interface:
EnchantItemEvent

public static interface EnchantItemEvent.CalculateLevelRequirement extends EnchantItemEvent
Triggers when the enchantment costs for an item are calculated.
  • Method Details

    • power

      int power()
      The enchantment power based on bookshelves around the enchantment table.
      Returns:
      the enchantment power
    • item

      The itemstack to enchant.
      Returns:
      the itemstack to enchant.
    • originalLevelRequirement

      int originalLevelRequirement()
      Returns the original level requirement
      Returns:
      the original level requirement
    • levelRequirement

      int levelRequirement()
      Returns the level requirement
      Returns:
      the level requirement
    • setLevelRequirement

      void setLevelRequirement(int value)
      Sets the new level requirement

      In vanilla the maximum value is 30.

      Returning a much higher level may result in no enchantments because the existing enchantments are too weak.

      Parameters:
      value - the new level requrement