Class BlockInteractEvent
java.lang.Object
com.sk89q.worldedit.event.Event
com.sk89q.worldedit.event.platform.BlockInteractEvent
- All Implemented Interfaces:
Cancellable
Called when a block is interacted with.
-
Constructor Summary
ConstructorsConstructorDescriptionBlockInteractEvent
(Actor cause, Location location, Interaction type) Deprecated.BlockInteractEvent
(Actor cause, Location location, Direction face, Interaction type) Create a new event. -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Get the cause of this event.getFace()
Get the face of the block that was interacted with.Get the location of the block that was interacted with.getType()
Get the type of interaction.boolean
Returns whether the event has been cancelled.void
setCancelled
(boolean cancelled) Set whether the event has been cancelled.
-
Constructor Details
-
BlockInteractEvent
Deprecated.Create a new event.- Parameters:
cause
- the causing actorlocation
- the location of the blocktype
- the type of interaction
-
BlockInteractEvent
public BlockInteractEvent(Actor cause, Location location, @Nullable Direction face, Interaction type) Create a new event.- Parameters:
cause
- the causing actorlocation
- the location of the blockface
- the face of the block that was interacted withtype
- the type of interaction
-
-
Method Details
-
getCause
Get the cause of this event.- Returns:
- the cause
-
getLocation
Get the location of the block that was interacted with.- Returns:
- the location
-
getFace
Get the face of the block that was interacted with.- Returns:
- The interacted face
-
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 interfaceCancellable
- 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 interfaceCancellable
- Parameters:
cancelled
- true if cancelled
-