Guide 1 Docs 2 Reference 3

Function of World

world.spawn

Puts an entity at a point and returns its handle. A mob kind of the game by name (world.spawn("cow", pos)) is the game's own entity, and takes no data. A pack's own kind takes the data it starts life holding. nil for a kind nothing defined and this game does not have.

world.spawn(def: EntityDef | string, pos: Vec3, data: { [string]: any }?) → EntityHandle?

Parameters

defEntityDef | stringrequired
posVec3required
data{ [string]: any }optional

Returns

EntityHandle?

Used in