Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.enchantment.EnchantItemEvent Class Reference
Inheritance diagram for org.bukkit.event.enchantment.EnchantItemEvent:
org.bukkit.event.inventory.InventoryEvent org.bukkit.event.Cancellable org.bukkit.event.Event

Public Member Functions

 EnchantItemEvent (final Player enchanter, final InventoryView view, final Block table, final ItemStack item, final int level, final Map< Enchantment, Integer > enchants, final int i)
 
Player getEnchanter ()
 
Block getEnchantBlock ()
 
ItemStack getItem ()
 
int getExpLevelCost ()
 
void setExpLevelCost (int level)
 
Map< Enchantment, Integer > getEnchantsToAdd ()
 
int whichButton ()
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.inventory.InventoryEvent
 InventoryEvent (InventoryView transaction)
 
Inventory getInventory ()
 
List< HumanEntitygetViewers ()
 
InventoryView getView ()
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

Static Public Member Functions

static HandlerList getHandlerList ()
 
- Static Public Member Functions inherited from org.bukkit.event.inventory.InventoryEvent
static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.inventory.InventoryEvent
InventoryView transaction
 

Detailed Description

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

Definition at line 19 of file EnchantItemEvent.java.

Member Function Documentation

Block org.bukkit.event.enchantment.EnchantItemEvent.getEnchantBlock ( )

Gets the block being used to enchant the item

Returns
the block used for enchanting

Definition at line 54 of file EnchantItemEvent.java.

54  {
55  return table;
56  }
Player org.bukkit.event.enchantment.EnchantItemEvent.getEnchanter ( )

Gets the player enchanting the item

Returns
enchanting player

Definition at line 45 of file EnchantItemEvent.java.

45  {
46  return enchanter;
47  }
Map<Enchantment, Integer> org.bukkit.event.enchantment.EnchantItemEvent.getEnchantsToAdd ( )

Get map of enchantment (levels, keyed by type) to be added to item (modify map returned to change values). Note: Any enchantments not allowed for the item will be ignored

Returns
map of enchantment levels, keyed by enchantment

Definition at line 92 of file EnchantItemEvent.java.

92  {
93  return enchants;
94  }
int org.bukkit.event.enchantment.EnchantItemEvent.getExpLevelCost ( )

Get cost in exp levels of the enchantment

Returns
experience level cost

Definition at line 72 of file EnchantItemEvent.java.

72  {
73  return level;
74  }
ItemStack org.bukkit.event.enchantment.EnchantItemEvent.getItem ( )

Gets the item to be enchanted (can be modified)

Returns
ItemStack of item

Definition at line 63 of file EnchantItemEvent.java.

63  {
64  return item;
65  }
boolean org.bukkit.event.enchantment.EnchantItemEvent.isCancelled ( )

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 105 of file EnchantItemEvent.java.

105  {
106  return cancelled;
107  }
void org.bukkit.event.enchantment.EnchantItemEvent.setCancelled ( boolean  cancel)

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Implements org.bukkit.event.Cancellable.

Definition at line 109 of file EnchantItemEvent.java.

109  {
110  this.cancelled = cancel;
111  }
void org.bukkit.event.enchantment.EnchantItemEvent.setExpLevelCost ( int  level)

Set cost in exp levels of the enchantment

Parameters
level- cost in levels

Definition at line 81 of file EnchantItemEvent.java.

81  {
82  this.level = level;
83  }
int org.bukkit.event.enchantment.EnchantItemEvent.whichButton ( )

Which button was pressed to initiate the enchanting.

Returns
The button index (0, 1, or 2).

Definition at line 101 of file EnchantItemEvent.java.

101  {
102  return button;
103  }

The documentation for this class was generated from the following file: