Package net.minecraftforge.event.level
Class PistonEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.BlockEvent
net.minecraftforge.event.level.PistonEvent
- Direct Known Subclasses:
- PistonEvent.Post,- PistonEvent.Pre
Base piston event, use 
PistonEvent.Post and PistonEvent.Pre- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumstatic classFires after the piston has moved and set surrounding states.static classFires before the piston has updated block states.Nested classes/interfaces inherited from class net.minecraftforge.event.level.BlockEventBlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEventNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final Directionprivate final PistonEvent.PistonMoveType
- 
Constructor SummaryConstructorsConstructorDescriptionPistonEvent(Level world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType) 
- 
Method SummaryModifier and TypeMethodDescriptionHelper method that gets the piston position offset by its facing@Nullable PistonStructureResolverMethods inherited from class net.minecraftforge.event.level.BlockEventgetLevel, getPos, getStateMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
direction
- 
moveType
 
- 
- 
Constructor Details- 
PistonEventpublic PistonEvent(Level world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType) - Parameters:
- pos- - The position of the piston
- direction- - The move direction of the piston
 
 
- 
- 
Method Details- 
getDirection- Returns:
- The direction of the piston block
 
- 
getFaceOffsetPosHelper method that gets the piston position offset by its facing
- 
getPistonMoveType- Returns:
- The movement type of the piston (extension, retraction)
 
- 
getStructureHelper- Returns:
- A piston structure helper for this movement. Returns null if the world stored is not a Level
 
 
-