Class BlockInteractEvent

java.lang.Object
com.sk89q.worldedit.event.Event
com.sk89q.worldedit.event.platform.BlockInteractEvent
All Implemented Interfaces:
Cancellable

public class BlockInteractEvent extends Event implements Cancellable
Called when a block is interacted with.
  • Constructor Details

    • BlockInteractEvent

      @Deprecated public BlockInteractEvent(Actor cause, Location location, Interaction type)
      Deprecated.
      Create a new event.
      Parameters:
      cause - the causing actor
      location - the location of the block
      type - the type of interaction
    • BlockInteractEvent

      public BlockInteractEvent(Actor cause, Location location, @Nullable Direction face, Interaction type)
      Create a new event.
      Parameters:
      cause - the causing actor
      location - the location of the block
      face - the face of the block that was interacted with
      type - the type of interaction
  • Method Details

    • getCause

      public Actor getCause()
      Get the cause of this event.
      Returns:
      the cause
    • getLocation

      public Location getLocation()
      Get the location of the block that was interacted with.
      Returns:
      the location
    • getFace

      @Nullable public Direction getFace()
      Get the face of the block that was interacted with.
      Returns:
      The interacted face
    • getType

      public Interaction getType()
      Get the type of interaction.
      Returns:
      the type of interaction
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Returns whether the event has been cancelled.
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if cancelled
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: Cancellable
      Set whether the event has been cancelled.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancelled - true if cancelled