Skip to content

@pumpkin-plugins/dynamic-lights-pumpkin API / plugin / EventHandler

Type Alias: EventHandler<T> ​

EventHandler<T> = (server, event) => T | undefined

Defined in: tools/pumpkin-api/src/core.ts:27

Handles one Pumpkin event and may return a replacement event payload.

Pumpkin applies the returned payload only for handlers registered as blocking. It ignores what a non-blocking handler returns, so such a handler cannot modify or cancel the event. Return undefined to leave the payload as it is.

Type Parameters ​

T ​

T = Event["val"]

Payload type accepted and optionally returned by the callback.

Parameters ​

server ​

Server

event ​

T

Returns ​

T | undefined

pumpkin-plugins documentation