Interface EnchantItemEvent.CalculateLevelRequirement
-
- All Superinterfaces:
Cancellable
,EnchantItemEvent
,Event
,InteractContainerEvent
- Enclosing interface:
- EnchantItemEvent
public static interface EnchantItemEvent.CalculateLevelRequirement extends EnchantItemEvent
Triggers when the enchantment costs for an item are calculated.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.event.item.inventory.EnchantItemEvent
EnchantItemEvent.CalculateEnchantment, EnchantItemEvent.CalculateLevelRequirement, EnchantItemEvent.Post
-
Nested classes/interfaces inherited from interface org.spongepowered.api.event.item.inventory.container.InteractContainerEvent
InteractContainerEvent.Close, InteractContainerEvent.Open
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ItemStackSnapshot
item()
The itemstack to enchant.int
levelRequirement()
Returns the level requirementint
originalLevelRequirement()
Returns the original level requirementint
power()
The enchantment power based on bookshelves around the enchantment table.void
setLevelRequirement(int value)
Sets the new level requirement-
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
Methods inherited from interface org.spongepowered.api.event.item.inventory.EnchantItemEvent
option, seed
-
Methods inherited from interface org.spongepowered.api.event.item.inventory.container.InteractContainerEvent
container, cursorTransaction
-
-
-
-
Method Detail
-
power
int power()
The enchantment power based on bookshelves around the enchantment table.- Returns:
- the enchantment power
-
item
ItemStackSnapshot item()
The itemstack to enchant.- Returns:
- the itemstack to enchant.
-
originalLevelRequirement
int originalLevelRequirement()
Returns the original level requirement- Returns:
- the original level requirement
-
levelRequirement
int levelRequirement()
Returns the level requirement- Returns:
- the level requirement
-
setLevelRequirement
void setLevelRequirement(int value)
Sets the new level requirementIn vanilla the maximum value is 30.
Returning a much higher level may result in no enchantments because the existing enchantments are too weak.
- Parameters:
value
- the new level requrement
-
-