Spawners

Spawners wrap entity summoning into reusable, pre-configured handles.

They are useful whenever the same mob or entity should be spawned multiple times with the same base configuration.

Registering a spawner

val zombieSpawner = registerSpawner("zombie", EntityTypes.ZOMBIE) {
	position = vec3(0, 64, 0)
}
Kotlin

Registering a spawner once helps keep coordinates, entity type, and spawn behavior in one predictable place.

Using a spawner

function("spawn_wave") {
	with(zombieSpawner) {
		spawn()                     // summon at configured position
		spawnAt(vec3(10, 64, 10))   // summon at a specific position
		spawnMultiple(5)            // summon multiple at configured position
	}
}
Kotlin
Function Description
spawn Summon at the configured position
spawnAt Summon at a specific position
spawnMultiple Summon N entities at configured pos

Example: spawning a wave

function("spawn_wave") {
	with(zombieSpawner) {
		spawnMultiple(5)
		spawnAt(vec3(12, 64, 12))
	}
}
Kotlin

This makes spawners a natural fit for waves, encounter scripts, arena refills, or scripted boss phases.

See also

  • Entities & Players – Operate on the spawned entities afterwards with higher-level helpers.
  • Teams – Assign spawned waves to teams when organizing PvE or faction-based encounters.
  • Events – React to deaths or interactions involving spawned entities.