Beta
Contains information related to changes to a button push.
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()}`, );}); Copy
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()}`, );});
Readonly
Block impacted by this event.
Dimension that contains the block that is the subject of this event.
Optional source that triggered the button push.
Contains information related to changes to a button push.
Example: buttonPushEvent.ts