Class BlockInteractEvent

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

public class BlockInteractEvent extends Object
Called when a player interacts with a block

This is only called when players interact with furnaces, cutters, or chests

  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    Gets the block type of the interacted block
    boolean
    Gets the dimension of the interacted block
    Gets the player who interacted with the block
    int
    Gets the X coordinate of the interacted block
    int
    Gets the Y coordinate of the interacted block
    boolean
    Gets whether this event is cancelled
    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

    • BlockInteractEvent

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

    • getPlayer

      public Player getPlayer()
      Gets the player who interacted with the block
      Returns:
      Player instance
    • getX

      public int getX()
      Gets the X coordinate of the interacted block
      Returns:
      X-coordinate
    • getY

      public int getY()
      Gets the Y coordinate of the interacted block
      Returns:
      Y-coordinate
    • getDimension

      public boolean getDimension()
      Gets the dimension of the interacted block
      Returns:
      Dimension (false = Overworld, true = End)
    • getBlock

      public Block getBlock()
      Gets the block type of the interacted 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