Package org.bukkit.event.block
Class BlockPistonEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.BlockPistonEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
BlockPistonExtendEvent,BlockPistonRetractEvent
Called when a piston block is triggered
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.block.BlockEvent
block -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockPistonEvent(@NotNull Block block, @NotNull BlockFace direction) -
Method Summary
Modifier and TypeMethodDescriptionReturn the direction in which the piston will operate.booleanGets the cancellation state of this event.booleanisSticky()Returnstrueif the Piston in the event is sticky.voidsetCancelled(boolean cancelled) Sets the cancellation state of this event.Methods inherited from class org.bukkit.event.block.BlockEvent
getBlockMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, getHandlers, isAsynchronous
-
Constructor Details
-
BlockPistonEvent
-
-
Method Details
-
isSticky
public boolean isSticky()Returnstrueif the Piston in the event is sticky.- Returns:
- stickiness of the piston
-
getDirection
Return the direction in which the piston will operate.- Returns:
- direction of the piston
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueif you wish to cancel this event
-