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

readViewTrait

readViewTrait<S>(source, entity, handle, rewind): DeepReadonly<TraitRecord<S>> | undefined

trait on entity as the player’s screen held it at the moment rewind names: the newer of the two sends round it, as the player’s page takes each send’s traits as it lands and draws toward it. Where it is read now, as on the player’s page, for the player’s own entity or in a game played alone, the value it holds now, which is the newer send’s whenever the moment lies between the last two. Undefined where the entity did not hold it, and where readViewPosition reads no place. The trait is one defined with history: true, which every send keeps. Read-only, and shared until the send leaves the history.

Type Parameter
S extends Schema
Parameter Type
source QuerySource
entity Entity
handle Trait<S> | PredictedTrait<S>
rewind Rewind

DeepReadonly<TraitRecord<S>> | undefined

const zones = readViewTrait(step, target, HitZonesTrait, command);