Interface EnchantedItem


@NonExtendable public interface EnchantedItem
An enchantment applied to a stack carried by a living entity, passed to the hooks of an EnchantmentBehaviour.

Instances are only valid for the duration of the hook and must not be kept.

Since:
0.1.0
  • Method Details

    • enchantment

      Returns the enchantment.
      Returns:
      the enchantment
      Since:
      0.1.0
    • level

      int level()
      Returns the level of the enchantment on the stack, starting at 1.
      Returns:
      the level of the enchantment on the stack, starting at 1
      Since:
      0.1.0
    • item

      ItemStack item()
      Returns the enchanted stack.
      Returns:
      the enchanted stack
      Since:
      0.1.0
    • slot

      Returns the slot the stack is worn or held in, or null if it is elsewhere in the inventory.
      Returns:
      the slot the stack is worn or held in, or null if it is elsewhere in the inventory
      Since:
      0.1.0
    • owner

      LivingEntity owner()
      Returns the entity carrying the stack.
      Returns:
      the entity carrying the stack
      Since:
      0.1.0