Interface Enchantment

    • Method Detail

      • of

        static Enchantment of​(java.util.function.Supplier<? extends EnchantmentType> enchantmentType,
                              int level)
                       throws java.lang.IllegalArgumentException
        Creates a new Enchantment with the provided EnchantmentType and level.
        Parameters:
        enchantmentType - The enchantment type
        level - The enchantment level
        Returns:
        The created enchantment
        Throws:
        java.lang.IllegalArgumentException - If the level is smaller than Short.MIN_VALUE or larger than Short.MAX_VALUE
      • of

        static Enchantment of​(EnchantmentType enchantmentType,
                              int level)
                       throws java.lang.IllegalArgumentException
        Creates a new Enchantment with the provided EnchantmentType and level.
        Parameters:
        enchantmentType - The enchantment type
        level - The enchantment level
        Returns:
        The created enchantment
        Throws:
        java.lang.IllegalArgumentException - If the level is smaller than Short.MIN_VALUE or larger than Short.MAX_VALUE
      • level

        int level()
        Gets the level of this enchantment.
        Returns:
        The level of this enchantment