Interface Enchantment.Builder

    • Method Detail

      • type

        default Enchantment.Builder type​(java.util.function.Supplier<? extends EnchantmentType> enchantmentType)
        Sets the EnchantmentType for this enchantment.
        Parameters:
        enchantmentType - The desired enchantment type
        Returns:
        The modified builder, for chaining
      • level

        Enchantment.Builder level​(int level)
                           throws java.lang.IllegalArgumentException
        Sets the level for this enchantment.

        This level must be between Short.MIN_VALUE and Short.MAX_VALUE, but there is no guarantee all levels will work properly without error. It is recommended for reliable results you stay between EnchantmentType.minimumLevel() and EnchantmentType.maximumLevel(), or at least larger than 0 and less than Short.MAX_VALUE.

        Parameters:
        level - The desired level
        Returns:
        The modified builder for chaining
        Throws:
        java.lang.IllegalArgumentException - If the level is smaller than Short.MIN_VALUE or larger than Short.MAX_VALUE