public class BlockDispenseEvent extends BlockEvent implements Cancellable
If a Block Dispense event is cancelled, the block will not dispense the item.
Event.Result
block
Constructor and Description |
---|
BlockDispenseEvent(Block block,
ItemStack dispensed,
Vector velocity) |
Modifier and Type | Method and Description |
---|---|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
ItemStack |
getItem()
Gets the item that is being dispensed.
|
Vector |
getVelocity()
Gets the velocity.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setItem(ItemStack item)
Sets the item being dispensed.
|
void |
setVelocity(Vector vel)
Sets the velocity of the item being dispensed.
|
getBlock
getEventName, isAsynchronous
public ItemStack getItem()
setItem(org.bukkit.inventory.ItemStack)
instead.public void setItem(ItemStack item)
item
- the item being dispensedpublic Vector getVelocity()
Note: Modifying the returned Vector will not change the velocity, you
must use setVelocity(org.bukkit.util.Vector)
instead.
public void setVelocity(Vector vel)
vel
- the velocity of the item being dispensedpublic boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this eventpublic HandlerList getHandlers()
getHandlers
in class Event
public static HandlerList getHandlerList()
Copyright © 2022. All rights reserved.