Manages callbacks that are connected to when a button is pushed.

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 (View Summary)

Methods