Class: ButtonPushAfterEvent
Contains information related to changes to a button push.
Example
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()}`,
);
});
Extends
Constructors
new ButtonPushAfterEvent()
private
new ButtonPushAfterEvent():ButtonPushAfterEvent
Returns
Overrides
Properties
block
readonly
block:Block
Remarks
Block impacted by this event.
Inherited from
dimension
readonly
dimension:Dimension
Remarks
Dimension that contains the block that is the subject of this event.
Inherited from
source
readonly
source:Entity
Remarks
Optional source that triggered the button push.