Cancellable
BlockDispenseArmorEvent
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 | Description |
---|---|
BlockDispenseEvent(Block block,
ItemStack dispensed,
Vector velocity) |
Modifier and Type | Method | 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
callEvent, getEventName, isAsynchronous
@NotNull public ItemStack getItem()
setItem(org.bukkit.inventory.ItemStack)
instead.public void setItem(@NotNull ItemStack item)
item
- the item being dispensed@NotNull public Vector getVelocity()
Note: Modifying the returned Vector will not change the velocity, you
must use setVelocity(org.bukkit.util.Vector)
instead.
public void setVelocity(@NotNull 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 event@NotNull public HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static HandlerList getHandlerList()
Copyright © 2020. All rights reserved.