Class BlockPlaceEvent

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

public class BlockPlaceEvent extends Object
Called when a player places a block
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockPlaceEvent​(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
    boolean
    Gets the dimension of the placed block
    Gets the block type of the placed block
    Gets the player who placed the block
    int
    Gets the X coordinate of the placed block
    int
    Gets the Y coordinate of the placed 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

    • BlockPlaceEvent

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

    • getPlayer

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

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