Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.block.BlockDamageEvent Class Reference
Inheritance diagram for org.bukkit.event.block.BlockDamageEvent:
org.bukkit.event.block.BlockEvent org.bukkit.event.Cancellable org.bukkit.event.Event

Public Member Functions

 BlockDamageEvent (final Player player, final Block block, final ItemStack itemInHand, final boolean instaBreak)
 
Player getPlayer ()
 
boolean getInstaBreak ()
 
void setInstaBreak (boolean bool)
 
ItemStack getItemInHand ()
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.block.BlockEvent
 BlockEvent (final Block theBlock)
 
final Block getBlock ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.block.BlockEvent
Block block
 

Detailed Description

Called when a block is damaged by a player.

If a Block Damage event is cancelled, the block will not be damaged.

Definition at line 14 of file BlockDamageEvent.java.

Member Function Documentation

boolean org.bukkit.event.block.BlockDamageEvent.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

Definition at line 44 of file BlockDamageEvent.java.

44  {
45  return instaBreak;
46  }
ItemStack org.bukkit.event.block.BlockDamageEvent.getItemInHand ( )

Gets the ItemStack for the item currently in the player's hand.

Returns
The ItemStack for the item currently in the player's hand

Definition at line 63 of file BlockDamageEvent.java.

63  {
64  return itemstack;
65  }
Player org.bukkit.event.block.BlockDamageEvent.getPlayer ( )

Gets the player damaging the block involved in this event.

Returns
The player damaging the block involved in this event

Definition at line 34 of file BlockDamageEvent.java.

34  {
35  return player;
36  }
boolean org.bukkit.event.block.BlockDamageEvent.isCancelled ( )

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 67 of file BlockDamageEvent.java.

67  {
68  return cancel;
69  }
void org.bukkit.event.block.BlockDamageEvent.setCancelled ( boolean  cancel)

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Implements org.bukkit.event.Cancellable.

Definition at line 71 of file BlockDamageEvent.java.

71  {
72  this.cancel = cancel;
73  }
void org.bukkit.event.block.BlockDamageEvent.setInstaBreak ( boolean  bool)

Sets if the block should instantly break when damaged by the player.

Parameters
booltrue if you want the block to instantly break when damaged by the player

Definition at line 54 of file BlockDamageEvent.java.

54  {
55  this.instaBreak = bool;
56  }

The documentation for this class was generated from the following file: