EnchantItemEvent

public class EnchantItemEvent extends InventoryEvent implements Cancellable

Called when an ItemStack is successfully enchanted (currently at enchantment table)

Constructors

Link copied to clipboard
public void EnchantItemEvent(Player enchanter, InventoryView view, Block table, ItemStack item, int level, Map<Enchantment, Integer> enchants, int i)

Properties

Link copied to clipboard
public final Player enchanter
Link copied to clipboard
public final static HandlerList handlers
Link copied to clipboard
public final ItemStack item

Functions

Link copied to clipboard
Gets the block being used to enchant the item
Link copied to clipboard
Gets the player enchanting the item
Link copied to clipboard
Get map of enchantment (levels, keyed by type) to be added to item (modify map returned to change values).
Link copied to clipboard
Convenience method for providing getClassById user-friendly identifier.
Link copied to clipboard
public int getExpLevelCost()
Get cost in exp levels of the enchantment
Link copied to clipboard
public static HandlerList getHandlerList()
Link copied to clipboard
Link copied to clipboard
Gets the primary Inventory involved in this transaction
Link copied to clipboard
public ItemStack getItem()
Gets the item to be enchanted (can be modified)
Link copied to clipboard
Gets the view object itself
Link copied to clipboard
Gets the list of players viewing the primary (upper) inventory involved in this event
Link copied to clipboard
public final boolean isAsynchronous()
Any custom event that should not by synchronized with other events must use the specific constructor.
Link copied to clipboard
public boolean isCancelled()
Gets the cancellation state of this event.
Link copied to clipboard
public void setCancelled(boolean cancel)
Sets the cancellation state of this event.
Link copied to clipboard
public void setExpLevelCost(int level)
Set cost in exp levels of the enchantment
Link copied to clipboard
public int whichButton()
Which button was pressed to initiate the enchanting.