Interface Enchantment.Builder

    • Method Detail

      • type

        default Enchantment.Builder type​(java.util.function.Supplier<? extends EnchantmentType> enchantmentType)
        Sets the EnchantmentType for this enchantment.
        enchantmentType - The desired enchantment type
        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.

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