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 Event
Event.Result -
Field Summary
Fields inherited from class 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 cancel) Sets the cancellation state of this event.Methods inherited from class BlockEvent
getBlockMethods inherited from class 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
-
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 cancel) 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:
cancel-trueif you wish to cancel this event
-