Contains information related to changes to a piston expanding or retracting.

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

Constructors

Properties

Constructors

Properties

block: Block

Remarks

Block impacted by this event.

dimension: Dimension

Remarks

Dimension that contains the block that is the subject of this event.

isExpanding: boolean

Remarks

True if the piston is the process of expanding.

Remarks

Contains additional properties and details of the piston.