Package io.papermc.paper.event.block
Class PlayerShearBlockEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.block.PlayerShearBlockEvent
- All Implemented Interfaces:
- Cancellable
Called when a player uses sheers on a block.
 
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.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetBlock()Gets the block being sheared in this event.getDrops()Gets the resulting drops of this event.getHand()Gets the hand used to shear the block.static @NotNull HandlerListgetItem()Gets the item used to shear the block.booleanGets whether the shearing of the block should be cancelled or not.voidsetCancelled(boolean cancel) Sets whether the shearing of the block should be cancelled or not.Methods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
PlayerShearBlockEvent
 
- 
- 
Method Details- 
getBlockGets the block being sheared in this event.- Returns:
- The Blockwhich block is being sheared in this event.
 
- 
getItemGets the item used to shear the block.- Returns:
- The ItemStackof the shears.
 
- 
getHandGets the hand used to shear the block.- Returns:
- Either EquipmentSlot.HANDOREquipmentSlot.OFF_HAND.
 
- 
getDropsGets the resulting drops of this event.
- 
isCancelledpublic boolean isCancelled()Gets whether the shearing of the block should be cancelled or not.- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- Whether the shearing of the block should be cancelled or not.
 
- 
setCancelledpublic void setCancelled(boolean cancel) Sets whether the shearing of the block should be cancelled or not.- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- whether the shearing of the block should be cancelled or not.
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-