Manages callbacks that are connected to piston activations.

Example

pistonAfterEvent.ts

import { world, system, PistonActivateAfterEvent } from '@minecraft/server';

world.afterEvents.pistonActivate.subscribe((pistonEvent: PistonActivateAfterEvent) => {
console.warn(
`Piston event at ${system.currentTick} ${(pistonEvent.piston.isMoving ? ' Moving' : 'Not moving')} with state: ${pistonEvent.piston.state}`,
);
});

Hierarchy

  • PistonActivateAfterEventSignal

Constructors

Methods

Constructors

Methods

  • Parameters

    Returns ((arg) => void)

      • (arg): void
      • Parameters

        Returns void

        Remarks

        This function can't be called in read-only mode.

        This function can be called in early-execution mode.

    Remarks

    This function can't be called in read-only mode.

    This function can be called in early-execution mode.

  • Parameters

    Returns void

    Remarks

    Removes a callback from being called when a piston expands or retracts.

    This function can't be called in read-only mode.

    This function can be called in early-execution mode.