public class BlockDispenseEvent extends BlockEvent implements Cancellable
If a Block Dispense event is cancelled, the block will not dispense the item.
Event.Resultblock| Constructor and Description | 
|---|
BlockDispenseEvent(@NotNull Block block,
                  @NotNull ItemStack dispensed,
                  @NotNull Vector velocity)  | 
| Modifier and Type | Method and 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. 
 | 
getBlockgetEventName, 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()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class Event@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.