Package org.bukkit.event.block
Class BlockDamageEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.BlockDamageEvent
- All Implemented Interfaces:
- Cancellable
Called when a block is damaged by a player.
 
If a Block Damage event is cancelled, the block will not be damaged.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.block.BlockEventblock
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic @NotNull HandlerListbooleanGets if the block is set to instantly break when damaged by the player.Gets the ItemStack for the item currently in the player's hand.Gets the player damaging the block involved in this event.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetInstaBreak(boolean bool) Sets if the block should instantly break when damaged by the player.Methods inherited from class org.bukkit.event.block.BlockEventgetBlockMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
BlockDamageEvent
 
- 
- 
Method Details- 
getPlayerGets the player damaging the block involved in this event.- Returns:
- The player damaging the block involved in this event
 
- 
getInstaBreakpublic boolean getInstaBreak()Gets if the block is set to instantly break when damaged by the player.- Returns:
- true if the block should instantly break when damaged by the player
 
- 
setInstaBreakpublic void setInstaBreak(boolean bool) Sets if the block should instantly break when damaged by the player.- Parameters:
- bool- true if you want the block to instantly break when damaged by the player
 
- 
getItemInHandGets the ItemStack for the item currently in the player's hand.- Returns:
- The ItemStack for the item currently in the player's hand
 
- 
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:
- true if this event is cancelled
 
- 
setCancelledpublic void setCancelled(boolean cancel) Description copied from interface:CancellableSets 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:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-