Interface EnchantItemEvent.CalculateEnchantment

    • Method Detail

      • item

        ItemStackSnapshot item()
        The itemstack to enchant.
        Returns:
        the itemstack to enchant.
      • originalEnchantments

        java.util.List<Enchantment> originalEnchantments()
        Returns the original list of enchantments to apply to the item.

        The first item in the list is used for display when previewing the enchantments.

        Returns:
        the list of enchantments
      • enchantments

        java.util.List<Enchantment> enchantments()
        Returns the list of enchantments to apply to the item.

        The first item in the list is used for display when previewing the enchantments.

        Returns:
        the list of enchantments
      • setEnchantments

        void setEnchantments​(java.util.List<Enchantment> enchantments)
        Sets the list of enchantments to apply to the item.

        The first item in the list is used for display when previewing the enchantments.

        Note that when modifying the enchantment list you should return the same enchantments for the same seed and option.

        See Enchantment.randomListBuilder() to generate enchantment lists.

        Parameters:
        enchantments - the new list of enchantments