Skip to content

API reference / @jsprismarine/spawning / Spawner

Class: Spawner ​

Defined in: spawner.ts:140

Runs the spawn loop for one world.

Constructors ​

Constructor ​

new Spawner(options): Spawner

Defined in: spawner.ts:152

Parameters ​

options ​

SpawnerOptions

Returns ​

Spawner

Accessors ​

pools ​

Get Signature ​

get pools(): readonly string[]

Defined in: spawner.ts:172

The pools the loaded rules name, which is what tick cycles.

Returns ​

readonly string[]

Methods ​

cycle() ​

cycle(pool, tick): readonly SpawnRequest[]

Defined in: spawner.ts:196

Runs one cycle of one pool, whatever the cadence says.

Parameters ​

pool ​

string

tick ​

number

Returns ​

readonly SpawnRequest[]

Every entity to create, never more than the pool's remaining cap.


tick() ​

tick(tick): readonly SpawnRequest[]

Defined in: spawner.ts:181

Runs every pool whose cadence falls on this tick.

Parameters ​

tick ​

number

Returns ​

readonly SpawnRequest[]

Every entity to create, in the order the cycles produced them.