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 Summary
Modifier and TypeMethodDescriptionReturns the enchantment.item()Returns the enchanted stack.intlevel()Returns the level of the enchantment on the stack, starting at1.owner()Returns the entity carrying the stack.slot()Returns the slot the stack is worn or held in, ornullif it is elsewhere in the inventory.
-
Method Details
-
enchantment
TypedKey<EnchantmentDefinition> enchantment()Returns the enchantment.- Returns:
- the enchantment
- Since:
- 0.1.0
-
level
int level()Returns the level of the enchantment on the stack, starting at1.- Returns:
- the level of the enchantment on the stack, starting at
1 - Since:
- 0.1.0
-
item
-
slot
@Nullable EquipmentSlot slot()Returns the slot the stack is worn or held in, ornullif it is elsewhere in the inventory.- Returns:
- the slot the stack is worn or held in, or
nullif 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
-