An opaque ECS identity created by spawn.
Signature
Entity stores a Rust u64 handle. IDs are allocated in creation order and cannot be constructed from a Number in the language. Copying a handle keeps the same identity; it does not duplicate the entity or its components.
Use get, set, has and bind with a concrete component type. A handle can outlive its entity, but subsequent access to a removed entity is rejected.
Examples
Share an entity identity
Both handles address the same entity, so the update through alias is visible through item.
main.kj
Loading…Drag to orbit · select to inspect
0 entities
Scene controls
Results
Loading the language runtime…
Output 0
No output.
State
Compile source to inspect its values.
TraceNo execution yet
- Executed source spans appear here.
Expected output
4
Rust definition
Value::Entity(u64); stable interpreter identity, not a pointer or a Rust SDK Entity struct.
View Rust documentation →Support: runtime