Class in @minecraft/server
An event to subscribe to. Callbacks run in the order they subscribed.
import { EventSignal } from '@minecraft/server';Methods
Section titled “Methods”subscribe
Section titled “subscribe”subscribe(callback: (arg0: T) => void, options?: O): (arg0: T) => void;Calls the callback each time the event fires.
callback(arg0: T) => voidoptionsoptionalOFor the packet events, which packets it hears.
(arg0: T) => voidThe callback, to unsubscribe it with.unsubscribe
Section titled “unsubscribe”unsubscribe(callback: (arg0: T) => void): void;Stops calling a callback.
callback(arg0: T) => void
Used by
Section titled “Used by”WorldBeforeEvents.chatSend, WorldBeforeEvents.effectAdd, WorldBeforeEvents.entityHurt, WorldBeforeEvents.entityRemove, WorldBeforeEvents.explosion, WorldBeforeEvents.itemUse, WorldBeforeEvents.playerBreakBlock, WorldBeforeEvents.playerChangeSkin, WorldBeforeEvents.playerDropItem, WorldBeforeEvents.playerEmote, WorldBeforeEvents.playerGameModeChange, WorldBeforeEvents.playerHurt, WorldBeforeEvents.playerInteractWithBlock, WorldBeforeEvents.playerInteractWithEntity, WorldBeforeEvents.playerLeave, WorldBeforeEvents.playerMove, WorldBeforeEvents.playerPickupItem, WorldBeforeEvents.playerPlaceBlock, WorldBeforeEvents.playerRespawn, WorldBeforeEvents.playerTeleport, WorldBeforeEvents.playerViolation, WorldBeforeEvents.weatherChange, WorldAfterEvents.entityHitEntity, WorldAfterEvents.blockExplode and 57 more