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

Public Member Functions

 PrepareItemEnchantEvent (final Player enchanter, InventoryView view, final Block table, final ItemStack item, final int[] levelsOffered, final int bonus)
 
Player getEnchanter ()
 
Block getEnchantBlock ()
 
ItemStack getItem ()
 
int[] getExpLevelCostsOffered ()
 
int getEnchantmentBonus ()
 
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 inserted in an enchantment table - can be called multiple times

Definition at line 15 of file PrepareItemEnchantEvent.java.

Member Function Documentation

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

Gets the block being used to enchant the item

Returns
the block used for enchanting

Definition at line 48 of file PrepareItemEnchantEvent.java.

48  {
49  return table;
50  }
Player org.bukkit.event.enchantment.PrepareItemEnchantEvent.getEnchanter ( )

Gets the player enchanting the item

Returns
enchanting player

Definition at line 39 of file PrepareItemEnchantEvent.java.

39  {
40  return enchanter;
41  }
int org.bukkit.event.enchantment.PrepareItemEnchantEvent.getEnchantmentBonus ( )

Get enchantment bonus in effect - corresponds to number of bookshelves

Returns
enchantment bonus

Definition at line 76 of file PrepareItemEnchantEvent.java.

76  {
77  return bonus;
78  }
int [] org.bukkit.event.enchantment.PrepareItemEnchantEvent.getExpLevelCostsOffered ( )

Get list of offered exp level costs of the enchantment (modify values to change offer)

Returns
experience level costs offered

Definition at line 67 of file PrepareItemEnchantEvent.java.

67  {
68  return levelsOffered;
69  }
ItemStack org.bukkit.event.enchantment.PrepareItemEnchantEvent.getItem ( )

Gets the item to be enchanted (can be modified)

Returns
ItemStack of item

Definition at line 57 of file PrepareItemEnchantEvent.java.

57  {
58  return item;
59  }
boolean org.bukkit.event.enchantment.PrepareItemEnchantEvent.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 80 of file PrepareItemEnchantEvent.java.

80  {
81  return cancelled;
82  }
void org.bukkit.event.enchantment.PrepareItemEnchantEvent.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 84 of file PrepareItemEnchantEvent.java.

84  {
85  this.cancelled = cancel;
86  }

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