public static interface EnchantItemEvent.CalculateLevelRequirement extends EnchantItemEvent
EnchantItemEvent.CalculateEnchantment, EnchantItemEvent.CalculateLevelRequirement, EnchantItemEvent.Post
Modifier and Type | Method and Description |
---|---|
ItemStackSnapshot |
getItem()
The itemstack to enchant.
|
int |
getLevelRequirement()
Returns the level requirement
|
int |
getOriginalLevelRequirement()
Returns the original level requirement
|
int |
getPower()
The enchantment power based on bookshelves around the enchantment table.
|
void |
setLevelRequirement(int value)
Sets the new level requirement
|
getOption, getSeed
getTargetInventory
getCause, getContext, getSource
int getPower()
ItemStackSnapshot getItem()
int getOriginalLevelRequirement()
int getLevelRequirement()
void setLevelRequirement(int value)
In vanilla the maximum value is 30.
Returning a much higher level may result in no enchantments because the existing enchantments are too weak.
value
- the new level requrement