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

twine / MobModuleRef

Interface: MobModuleRef โ€‹

Defined in: twine/src/mob/types.ts:18

A mob module plus handles to its generated functions. Read them after registration.

Extends โ€‹

Properties โ€‹

__configured โ€‹

readonly __configured: true

Defined in: twine/src/core/module.interface.ts:109

Inherited from โ€‹

ConfiguredModule.__configured


gestures โ€‹

readonly gestures: Record<string, FunctionRef>

Defined in: twine/src/mob/types.ts:26

Each gesture's raise function, by name - call it as the mob.


instance โ€‹

readonly instance: DatapackModule

Defined in: twine/src/core/module.interface.ts:111

Inherited from โ€‹

ConfiguredModule.instance


readonly menu: Pick<MobModuleOpts, "group" | "tags" | "menu">

Defined in: twine/src/mob/types.ts:30

Where it shows in the admin mob menu.


metadata โ€‹

readonly metadata: ModuleMetadata

Defined in: twine/src/core/module.interface.ts:110

Inherited from โ€‹

ConfiguredModule.metadata


onTickFn โ€‹

readonly onTickFn: FunctionRef

Defined in: twine/src/mob/types.ts:24

<name>/on_tick, the onTick body. Throws if there isn't one.


spawn โ€‹

readonly spawn: FunctionRef

Defined in: twine/src/mob/types.ts:22

<name>/spawn: summons one at the nearest player.


states โ€‹

readonly states: Record<string, FunctionRef>

Defined in: twine/src/mob/types.ts:28

Each state's enter function, by name - call it as the mob.


summon โ€‹

readonly summon: FunctionRef

Defined in: twine/src/mob/types.ts:20

Summons the mob wherever it is run - ctx.execute().at(...).run(b => b.call(mob.summon)).

Methods โ€‹

preview() โ€‹

preview(): MobPreview

Defined in: twine/src/mob/types.ts:32

The model and gesture timelines as plain data - what writeMobPreview renders.

Returns โ€‹

MobPreview

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