Contains information related to changes to a button push.

Example

buttonPushEvent.ts

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

world.afterEvents.buttonPush.subscribe((buttonPushEvent: ButtonPushAfterEvent) => {
const eventLoc = buttonPushEvent.block.location;

world.sendMessage(
`Button push event at tick ${system.currentTick} Power:${buttonPushEvent.block.getRedstonePower()}`,
);
});

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.

source: Entity

Remarks

Optional source that triggered the button push.