Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

spool / MobStates

Interface: MobStates<S> โ€‹

Defined in: plugins/mob/types.ts:46

A mob's state switch, handed to every body that runs as the mob.

Type Parameters โ€‹

S โ€‹

S extends string

Properties โ€‹

clock โ€‹

readonly clock: Score

Defined in: plugins/mob/types.ts:61

Polls left in the current timed state, on @s - what phases within a state test.

Methods โ€‹

byDifficulty() โ€‹

byDifficulty(ctx, body): void

Defined in: plugins/mob/types.ts:56

Runs body for the pack's difficulty level, e.g. damage(..., config[level].hitDamage).

Built once per level, so if (!config[level].shockwave) return drops a feature.

Parameters โ€‹

ctx โ€‹

FunctionContext

body โ€‹

(ctx, level) => void

Returns โ€‹

void


enter() โ€‹

enter(ctx, state): void

Defined in: plugins/mob/types.ts:48

Put this mob (@s) into state, running its onEnter.

Parameters โ€‹

ctx โ€‹

FunctionContext

state โ€‹

S

Returns โ€‹

void


leave() โ€‹

leave(ctx): void

Defined in: plugins/mob/types.ts:50

Take this mob (@s) out of any state.

Parameters โ€‹

ctx โ€‹

FunctionContext

Returns โ€‹

void

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.