Package org.bukkit.event.block
Class BlockBreakEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.BlockExpEvent
org.bukkit.event.block.BlockBreakEvent
- All Implemented Interfaces:
- Cancellable
Called when a block is broken by a player.
 
If you wish to have the block drop experience, you must set the experience value above 0. By default, experience will be set in the event if:
- The player is not in creative or adventure mode
- The player can loot the block (ie: does not destroy it completely, by using the correct tool)
- The player does not have silk touch
- The block drops experience in vanilla Minecraft
Note: Plugins wanting to simulate a traditional block drop should set the block to air and utilize their own methods for determining what the default drop for the block being broken is and what to do about it, if anything.
If this event is cancelled, the block will not break and experience will not drop.
- 
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 TypeMethodDescriptionGets the Player that is breaking the block involved in this event.booleanGets the cancellation state of this event.booleanGets whether the block will attempt to drop items.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetDropItems(boolean dropItems) Sets whether the block will attempt to drop items as it normally would.Methods inherited from class org.bukkit.event.block.BlockExpEventgetExpToDrop, getHandlerList, getHandlers, setExpToDropMethods inherited from class org.bukkit.event.block.BlockEventgetBlockMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
BlockBreakEvent
 
- 
- 
Method Details- 
getPlayerGets the Player that is breaking the block involved in this event.- Returns:
- The Player that is breaking the block involved in this event
 
- 
setDropItemspublic void setDropItems(boolean dropItems) Sets whether the block will attempt to drop items as it normally would.If and only if this is falsethenBlockDropItemEventwill not be called after this event.- Parameters:
- dropItems- Whether the block will attempt to drop items
 
- 
isDropItemspublic boolean isDropItems()Gets whether the block will attempt to drop items.If and only if this is falsethenBlockDropItemEventwill not be called after this event.- Returns:
- Whether the block will attempt to drop items
 
- 
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:
- trueif 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-- trueif you wish to cancel this event
 
 
-