Beta
Manages callbacks that are connected to lever moves (activates or deactivates).
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()}`, );});
Subscribes to the event.
This function can't be called in read-only mode.
Unsubscribes from the event.
Manages callbacks that are connected to lever moves (activates or deactivates).
Example: leverActionEvent.ts