Interface in @minecraft/server
A piston began to push out or pull back in.
import type { PistonActivateAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.pistonActivate.
Example
Section titled “Example”import { world, type PistonActivateAfterEvent } from '@minecraft/server';
world.afterEvents.pistonActivate.subscribe((event: PistonActivateAfterEvent) => { console.log('pistonActivate', event.block.typeId, event.dimension.id, event.isExpanding);});import { world } from '@minecraft/server';
world.afterEvents.pistonActivate.subscribe((event) => { console.log('pistonActivate', event.block.typeId, event.dimension.id, event.isExpanding);});Properties
Section titled “Properties”read-only
readonly block: Block;Types
dimension
Section titled “dimension”read-only
readonly dimension: Dimension;Types
isExpanding
Section titled “isExpanding”read-only
readonly isExpanding: boolean;piston
Section titled “piston”read-only
readonly piston: BlockPistonComponent;Types
Used by
Section titled “Used by”WorldAfterEvents.pistonActivate, PistonActivateAfterEventSignal.subscribe, PistonActivateAfterEventSignal.unsubscribe