|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.BlockPlaceEvent
public class BlockPlaceEvent
Called when a block is placed by a player.
If a Block Place event is cancelled, the block will not be placed.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.bukkit.event.Event |
|---|
Event.Result |
| Field Summary | |
|---|---|
protected boolean |
canBuild
|
protected boolean |
cancel
|
protected ItemStack |
itemInHand
|
protected Block |
placedAgainst
|
protected Player |
player
|
protected BlockState |
replacedBlockState
|
| Fields inherited from class org.bukkit.event.block.BlockEvent |
|---|
block |
| Constructor Summary | |
|---|---|
BlockPlaceEvent(Block placedBlock,
BlockState replacedBlockState,
Block placedAgainst,
ItemStack itemInHand,
Player thePlayer,
boolean canBuild)
|
|
| Method Summary | |
|---|---|
boolean |
canBuild()
Gets the value whether the player would be allowed to build here. |
Block |
getBlockAgainst()
Gets the block that this block was placed against |
Block |
getBlockPlaced()
Clarity method for getting the placed block. |
BlockState |
getBlockReplacedState()
Gets the BlockState for the block which was replaced. |
static HandlerList |
getHandlerList()
|
HandlerList |
getHandlers()
|
ItemStack |
getItemInHand()
Gets the item in the player's hand when they placed the block. |
Player |
getPlayer()
Gets the player who placed the block involved in this event. |
boolean |
isCancelled()
Gets the cancellation state of this event. |
void |
setBuild(boolean canBuild)
Sets the canBuild state of this event. |
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event. |
| 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 |
| Field Detail |
|---|
protected boolean cancel
protected boolean canBuild
protected Block placedAgainst
protected BlockState replacedBlockState
protected ItemStack itemInHand
protected Player player
| Constructor Detail |
|---|
public BlockPlaceEvent(Block placedBlock,
BlockState replacedBlockState,
Block placedAgainst,
ItemStack itemInHand,
Player thePlayer,
boolean canBuild)
| Method Detail |
|---|
public boolean isCancelled()
Cancellable
isCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
Cancellable
setCancelled in interface Cancellablecancel - true if you wish to cancel this eventpublic Player getPlayer()
public Block getBlockPlaced()
public BlockState getBlockReplacedState()
public Block getBlockAgainst()
public ItemStack getItemInHand()
public boolean canBuild()
public void setBuild(boolean canBuild)
canBuild - true if you want the player to be able to buildpublic HandlerList getHandlers()
getHandlers in class Eventpublic static HandlerList getHandlerList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||