Class BlockPlaceEvent
java.lang.Object
com.welcome234.pluginsystem.events.BlockPlaceEvent
Called when a player places a block
-
Constructor Summary
ConstructorsConstructorDescriptionBlockPlaceEvent(String playername, int x, int y, boolean endDimension, Block block) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBuild()Gets whether building is allowed for this eventbooleanGets the dimension of the placed blockGets the block type of the placed blockGets the player who placed the blockintgetX()Gets the X coordinate of the placed blockintgetY()Gets the Y coordinate of the placed blockbooleanGets whether this event is cancelledvoidsetBuild(boolean canBuild)Sets whether building is allowed for this eventvoidsetCancelled(boolean cancelled)Sets the cancellation status of this event
-
Constructor Details
-
BlockPlaceEvent
-
-
Method Details
-
getPlayer
Gets the player who placed the block- Returns:
- Player instance
-
getX
public int getX()Gets the X coordinate of the placed block- Returns:
- X-coordinate
-
getY
public int getY()Gets the Y coordinate of the placed block- Returns:
- Y-coordinate
-
getDimension
public boolean getDimension()Gets the dimension of the placed block- Returns:
- Dimension (false = Overworld, true = End)
-
getPlacedBlock
Gets the block type of the placed block- Returns:
- Block type
-
isCancelled
public boolean isCancelled()Gets whether this event is cancelled- Returns:
- Whether cancelled
-
setCancelled
public void setCancelled(boolean cancelled)Sets the cancellation status of this event- Parameters:
cancelled- Whether cancelled
-
canBuild
public boolean canBuild()Gets whether building is allowed for this event- Returns:
- Whether building allowed
-
setBuild
public void setBuild(boolean canBuild)Sets whether building is allowed for this event- Parameters:
canBuild- Whether build allowed
-