public class BlockBreakEvent extends BlockExpEvent implements Cancellable
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:
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 a Block Break event is cancelled, the block will not break and experience will not drop.
Event.Result
block
Constructor and Description |
---|
BlockBreakEvent(Block theBlock,
Player player) |
Modifier and Type | Method and Description |
---|---|
Player |
getPlayer()
Gets the Player that is breaking the block involved in this event.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
getExpToDrop, getHandlerList, getHandlers, setExpToDrop
getBlock
getEventName, isAsynchronous
public Player getPlayer()
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this eventCopyright © 2014. All rights reserved.