Class BlockBreakEvent
java.lang.Object
com.welcome234.pluginsystem.events.BlockBreakEvent
Called when a player breaks a block
-
Constructor Summary
ConstructorsConstructorDescriptionBlockBreakEvent(String playername, int x, int y, boolean endDimension, Block block) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBuild()Gets whether building is allowed for this eventGets the block type of the destroyed blockbooleanGets the dimension of the destroyed blockGets the player who destroyed the blockintgetX()Gets the X coordinate of the destroyed blockintgetY()Gets the Y coordinate of the destroyed 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
-
BlockBreakEvent
-
-
Method Details
-
getPlayer
Gets the player who destroyed the block- Returns:
- Player instance
-
getX
public int getX()Gets the X coordinate of the destroyed block- Returns:
- X-coordinate
-
getY
public int getY()Gets the Y coordinate of the destroyed block- Returns:
- Y-coordinate
-
getDimension
public boolean getDimension()Gets the dimension of the destroyed block- Returns:
- Dimension (false = Overworld, true = End)
-
getBrokenBlock
Gets the block type of the destroyed 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
-