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(@NotNull Block block,
@NotNull ItemStack dispensed,
@NotNull Vector velocity) |
Modifier and Type | Method | Description |
---|---|---|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
@NotNull ItemStack |
getItem() |
Gets the item that is being dispensed.
|
@NotNull 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(@NotNull ItemStack item) |
Sets the item being dispensed.
|
void |
setVelocity(@NotNull Vector vel) |
Sets the velocity of the item being dispensed.
|
getBlock
getEventName, isAsynchronous
@NotNull public @NotNull ItemStack getItem()
setItem(org.bukkit.inventory.ItemStack)
instead.public void setItem(@NotNull @NotNull ItemStack item)
item
- the item being dispensed@NotNull public @NotNull 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 @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 @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2020. All rights reserved.