Beta
Contains information related to changes to a lever activating or deactivating.
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()}`, );}); Copy
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()}`, );});
Readonly
Block impacted by this event.
Dimension that contains the block that is the subject of this event.
True if the lever is activated (that is, transmitting power).
Optional player that triggered the lever activation.
Contains information related to changes to a lever activating or deactivating.
Example: leverActionEvent.ts