Class BlockDestroyEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.BlockExpEvent
com.destroystokyo.paper.event.block.BlockDestroyEvent
- All Implemented Interfaces:
- Cancellable
Fired anytime the server intends to 'destroy' a block through some triggering reason.
 This does not fire anytime a block is set to air, but only with more direct triggers such
 as physics updates, pistons, Entities changing blocks, commands set to "Destroy".
 
This event is associated with the game playing a sound effect at the block in question, when something can be described as "intend to destroy what is there",
Events such as leaves decaying, pistons retracting (where the block is moving), does NOT fire this event.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.block.BlockEventblock
- 
Constructor SummaryConstructorsConstructorDescriptionBlockDestroyEvent(Block block, BlockData newState, BlockData effectBlock, int xp, boolean willDrop) 
- 
Method SummaryModifier and TypeMethodDescriptionGet the effect that will be played when the block is broken.static HandlerListbooleanGets the cancellation state of this event.booleanvoidsetCancelled(boolean cancel) If the event is cancelled, the block will remain in its previous state.voidsetEffectBlock(BlockData effectBlock) Sets the effect that will be played when the block is broken.voidsetPlayEffect(boolean playEffect) voidsetWillDrop(boolean willDrop) booleanwillDrop()Methods inherited from class org.bukkit.event.block.BlockExpEventgetExpToDrop, setExpToDropMethods inherited from class org.bukkit.event.block.BlockEventgetBlockMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
BlockDestroyEvent
 
- 
- 
Method Details- 
getEffectBlockGet the effect that will be played when the block is broken.- Returns:
- block break effect
 
- 
setEffectBlockSets the effect that will be played when the block is broken. Note:playEffect()must betruein order for this effect to be played.- Parameters:
- effectBlock- block effect
 
- 
getNewState- Returns:
- The new state of this block (Air, or a Fluid type)
 
- 
willDroppublic boolean willDrop()- Returns:
- If the server is going to drop the block in question with this destroy event
 
- 
setWillDroppublic void setWillDrop(boolean willDrop) - Parameters:
- willDrop- If the server is going to drop the block in question with this destroy event
 
- 
playEffectpublic boolean playEffect()- Returns:
- If the server is going to play the sound effect for this destruction
 
- 
setPlayEffectpublic void setPlayEffect(boolean playEffect) - Parameters:
- playEffect- If the server should play the sound effect for this destruction
 
- 
isCancelledpublic boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- If the event is cancelled, meaning the block will not be destroyed
 
- 
setCancelledpublic void setCancelled(boolean cancel) If the event is cancelled, the block will remain in its previous state.- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlers- Overrides:
- getHandlersin class- BlockExpEvent
 
- 
getHandlerList
 
-