Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

findEntity

findEntity(world, predictedQuery, test?): Entity | undefined

The first entity query matches that passes test, in the order world.query lists them, or the first of all with no test, building no array. test reads and never writes: the list it walks is live.

Parameter Type
world World
predictedQuery Query | PredictedQuery<EngineQueryParameter[]>
test? (entity) => boolean

Entity | undefined