Class BlockBreakEvent

java.lang.Object
com.welcome234.pluginsystem.events.BlockBreakEvent

public class BlockBreakEvent extends Object
Called when a player breaks a block
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockBreakEvent​(String playername, int x, int y, boolean endDimension, Block block)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Gets whether building is allowed for this event
    Gets the block type of the destroyed block
    boolean
    Gets the dimension of the destroyed block
    Gets the player who destroyed the block
    int
    Gets the X coordinate of the destroyed block
    int
    Gets the Y coordinate of the destroyed block
    boolean
    Gets whether this event is cancelled
    void
    setBuild​(boolean canBuild)
    Sets whether building is allowed for this event
    void
    setCancelled​(boolean cancelled)
    Sets the cancellation status of this event

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlockBreakEvent

      public BlockBreakEvent(String playername, int x, int y, boolean endDimension, Block block)
  • Method Details

    • getPlayer

      public Player 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

      public Block 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