Interface EnchantItemEvent.CalculateLevelRequirement

    • Method Detail

      • power

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

        ItemStackSnapshot 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