spawn

fun World.spawn(entity: EntityType, location: Location, editor: Entity.() -> Unit = {}): Entity

Spawns an entity of the specified type at the given location in this world.

Return

The spawned entity

Parameters

entity

The type of entity to spawn

location

The location where the entity should be spawned

editor

Optional lambda to configure the entity after spawning


inline fun <E : Entity> World.spawn(location: Location, noinline editor: E.() -> Unit = {}): E

Spawns an entity of type E at the given location in this world.

Return

The spawned entity of type E

Parameters

location

The location where the entity should be spawned

editor

Optional lambda to configure the entity after spawning

Type Parameters

E

The type of entity to spawn


fun Location.spawn(entity: EntityType, editor: Entity.() -> Unit = {}): Entity

Spawns an entity of the specified type at this location.

Return

The spawned entity

Parameters

entity

The type of entity to spawn

editor

Optional lambda to configure the entity after spawning


inline fun <E : Entity> Location.spawn(noinline editor: E.() -> Unit = {}): E

Spawns an entity of type E at this location.

Return

The spawned entity of type E

Parameters

editor

Optional lambda to configure the entity after spawning

Type Parameters

E

The type of entity to spawn