Class PistonEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.PistonEvent
Direct Known Subclasses:
PistonEvent.Post, PistonEvent.Pre

public abstract class PistonEvent extends BlockEvent
Base piston event, use PistonEvent.Post and PistonEvent.Pre
  • Field Details

  • Constructor Details

  • Method Details

    • getDirection

      public Direction getDirection()
      Returns:
      The direction of the piston block
    • getFaceOffsetPos

      public BlockPos getFaceOffsetPos()
      Helper method that gets the piston position offset by its facing
    • getPistonMoveType

      public PistonEvent.PistonMoveType getPistonMoveType()
      Returns:
      The movement type of the piston (extension, retraction)
    • getStructureHelper

      @Nullable public @Nullable PistonStructureResolver getStructureHelper()
      Returns:
      A piston structure helper for this movement. Returns null if the world stored is not a Level