Function of World
world.entities
Live and queued entities, in ascending id. Optional near/radius select a sphere; kind filters by canonical name. near and radius go together. mob = true gives the mobs only, mob = false the rest.
world.entities(query: { near: Vec3?, radius: number?, kind: string?, mob: boolean? }?) → { EntityHandle }Parameters
query{ near: Vec3?, radius: number?, kind: string?, mob: boolean? }Returns
{ EntityHandle }Used in
for _, it in world.entities { near = vec3(at.x + 0.5, at.y + 1, at.z + 0.5), radius = 1.5 } doCustom blocks`world.entities`, as well as handles passed to hooks.Custom blocksentity here: players are in `players`, never in `world.entities`. `game.entities.<kind>`Game dataworld.entities { mob = true } -- every mob in this room, as handlesMobs and dropsworld.entities { mob = false } -- every entity that is not a mobMobs and drops| `id` | the entity id, as `e.id` and `world.entities()` give it |Custom entities`world.spawn` returns a handle, `world.entities()` lists handles, and eachCustom entities