public static interface EnchantItemEvent.CalculateEnchantment extends EnchantItemEvent
EnchantItemEvent.CalculateEnchantment, EnchantItemEvent.CalculateLevelRequirement, EnchantItemEvent.Post
Modifier and Type | Method and Description |
---|---|
List<Enchantment> |
getEnchantments()
Returns the list of enchantments to apply to the item.
|
ItemStackSnapshot |
getItem()
The itemstack to enchant.
|
int |
getLevelRequirement()
The final level requirement from
EnchantItemEvent.CalculateLevelRequirement . |
List<Enchantment> |
getOriginalEnchantments()
Returns the original list of enchantments to apply to the item.
|
void |
setEnchantments(List<Enchantment> enchantments)
Sets the list of enchantments to apply to the item.
|
getOption, getSeed
getTargetInventory
getCause, getContext, getSource
ItemStackSnapshot getItem()
int getLevelRequirement()
EnchantItemEvent.CalculateLevelRequirement
.
In vanilla the maximum value is 30.
List<Enchantment> getOriginalEnchantments()
The first item in the list is used for display when previewing the enchantments.
List<Enchantment> getEnchantments()
The first item in the list is used for display when previewing the enchantments.
void setEnchantments(List<Enchantment> enchantments)
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.
enchantments
- the new list of enchantments