Cancellablepublic class PlayerShearBlockEvent extends PlayerEvent implements Cancellable
This event is not called when breaking blocks with shears but instead only when a player uses the sheer item on a block to garner drops from said block and/or change its state.
Examples include shearing a pumpkin to turn it into a carved pumpkin or shearing a beehive to get honeycomb.
Event.Resultplayer| Constructor | Description |
|---|---|
PlayerShearBlockEvent(Player who,
Block block,
ItemStack item,
EquipmentSlot hand,
List<ItemStack> drops) |
| Modifier and Type | Method | Description |
|---|---|---|
Block |
getBlock() |
Gets the block being sheared in this event.
|
List<ItemStack> |
getDrops() |
Gets the resulting drops of this event.
|
EquipmentSlot |
getHand() |
Gets the hand used to shear the block.
|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
ItemStack |
getItem() |
Gets the item used to shear the block.
|
boolean |
isCancelled() |
Gets whether the shearing of the block should be cancelled or not.
|
void |
setCancelled(boolean cancel) |
Sets whether the shearing of the block should be cancelled or not.
|
callEvent, getEventName, isAsynchronousclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPlayer@NotNull public Block getBlock()
Block which block is being sheared in this event.@NotNull public ItemStack getItem()
ItemStack of the shears.@NotNull public EquipmentSlot getHand()
EquipmentSlot.HAND OR EquipmentSlot.OFF_HAND.public boolean isCancelled()
isCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
setCancelled in interface Cancellablecancel - whether the shearing of the block should be cancelled or not.@NotNull public HandlerList getHandlers()
getHandlers in class Event@NotNull public static HandlerList getHandlerList()
Copyright © 2021. All rights reserved.