Class: LeverActionAfterEvent
Contains information related to changes to a lever activating or deactivating.
Example
import { world, system, LeverActionAfterEvent } from '@minecraft/server';
world.afterEvents.leverAction.subscribe((leverActivateEvent: LeverActionAfterEvent) => {
console.warn(
`Lever event at ${system.currentTick} with power: ${leverActivateEvent.block.getRedstonePower()}`,
);
});
Extends
Constructors
new LeverActionAfterEvent()
private
new LeverActionAfterEvent():LeverActionAfterEvent
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
isPowered
readonly
isPowered:boolean
Remarks
True if the lever is activated (that is, transmitting power).
player
readonly
player:Player
Remarks
Optional player that triggered the lever activation.