Interface EnchantItemEvent.CalculateLevelRequirement
- All Superinterfaces:
Cancellable
,EnchantItemEvent
,Event
,InteractContainerEvent
- Enclosing interface:
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
Modifier and TypeMethodDescriptionitem()
The itemstack to enchant.int
Returns the level requirementint
Returns the original level requirementint
power()
The enchantment power based on bookshelves around the enchantment table.void
setLevelRequirement
(int value) Sets the new level requirementMethods 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 Details
-
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
-