Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.block.BlockDispenseEvent Class Reference
Inheritance diagram for org.bukkit.event.block.BlockDispenseEvent:
org.bukkit.event.block.BlockEvent org.bukkit.event.Cancellable org.bukkit.event.Event

Public Member Functions

 BlockDispenseEvent (final Block block, final ItemStack dispensed, final Vector velocity)
 
ItemStack getItem ()
 
void setItem (ItemStack item)
 
Vector getVelocity ()
 
void setVelocity (Vector vel)
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.block.BlockEvent
 BlockEvent (final Block theBlock)
 
final Block getBlock ()
 
- 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 ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.block.BlockEvent
Block block
 

Detailed Description

Called when an item is dispensed from a block.

If a Block Dispense event is cancelled, the block will not dispense the item.

Definition at line 15 of file BlockDispenseEvent.java.

Member Function Documentation

ItemStack org.bukkit.event.block.BlockDispenseEvent.getItem ( )

Gets the item that is being dispensed. Modifying the returned item will have no effect, you must use setItem(org.bukkit.inventory.ItemStack) instead.

Returns
An ItemStack for the item being dispensed

Definition at line 34 of file BlockDispenseEvent.java.

34  {
35  return item.clone();
36  }
Vector org.bukkit.event.block.BlockDispenseEvent.getVelocity ( )

Gets the velocity.

Note: Modifying the returned Vector will not change the velocity, you must use setVelocity(org.bukkit.util.Vector) instead.

Returns
A Vector for the dispensed item's velocity

Definition at line 55 of file BlockDispenseEvent.java.

References org.bukkit.util.Vector.clone().

55  {
56  return velocity.clone();
57  }
boolean org.bukkit.event.block.BlockDispenseEvent.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 68 of file BlockDispenseEvent.java.

68  {
69  return cancelled;
70  }
void org.bukkit.event.block.BlockDispenseEvent.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 72 of file BlockDispenseEvent.java.

72  {
73  cancelled = cancel;
74  }
void org.bukkit.event.block.BlockDispenseEvent.setItem ( ItemStack  item)

Sets the item being dispensed.

Parameters
itemthe item being dispensed

Definition at line 43 of file BlockDispenseEvent.java.

43  {
44  this.item = item;
45  }
void org.bukkit.event.block.BlockDispenseEvent.setVelocity ( Vector  vel)

Sets the velocity of the item being dispensed.

Parameters
velthe velocity of the item being dispensed

Definition at line 64 of file BlockDispenseEvent.java.

64  {
65  velocity = vel;
66  }

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