|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.event.Event org.bukkit.event.block.BlockEvent org.bukkit.event.block.BlockDamageEvent
public class BlockDamageEvent
Called when a block is damaged by a player.
If a Block Damage event is cancelled, the block will not be damaged.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.bukkit.event.Event |
---|
Event.Result |
Field Summary |
---|
Fields inherited from class org.bukkit.event.block.BlockEvent |
---|
block |
Constructor Summary | |
---|---|
BlockDamageEvent(Player player,
Block block,
ItemStack itemInHand,
boolean instaBreak)
|
Method Summary | |
---|---|
static HandlerList |
getHandlerList()
|
HandlerList |
getHandlers()
|
boolean |
getInstaBreak()
Gets if the block is set to instantly break when damaged by the player. |
ItemStack |
getItemInHand()
Gets the ItemStack for the item currently in the player's hand. |
Player |
getPlayer()
Gets the player damaging 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. |
void |
setInstaBreak(boolean bool)
Sets if the block should instantly break when damaged by the player. |
Methods inherited from class org.bukkit.event.block.BlockEvent |
---|
getBlock |
Methods inherited from class org.bukkit.event.Event |
---|
getEventName, isAsynchronous |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlockDamageEvent(Player player, Block block, ItemStack itemInHand, boolean instaBreak)
Method Detail |
---|
public Player getPlayer()
public boolean getInstaBreak()
public void setInstaBreak(boolean bool)
bool
- true if you want the block to instantly break when damaged by the playerpublic ItemStack getItemInHand()
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 eventpublic HandlerList getHandlers()
getHandlers
in class Event
public static HandlerList getHandlerList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |