Class: Entities
An interceptor for the network layer. When registered to a network instance, the network instance will run through all network packets through the interceptor, and also allowing the interceptor to send packets to the server.
Hierarchy
-
Group↳
Entities
Implements
Constructors
constructor
• new Entities(options?): Entities
Parameters
| Name | Type |
|---|---|
options | Partial<EntitiesOptions> |
Returns
Overrides
Group.constructor
Properties
map
• map: Map<string, Entity<any>>
options
• options: EntitiesOptions
packets
• packets: MessageProtocol[] = []
Requests for the server (see setOnRequestMetadata).
Implementation of
types
• types: Map<string, (id: string) => Entity<any> | (id: string) => Entity<any>>
Methods
appliedTick
▸ appliedTick(id): number
Parameters
| Name | Type |
|---|---|
id | string |
Returns
number
getEntityById
▸ getEntityById(id): Entity<any>
Get an entity instance by its ID.
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The ID of the entity to get. |
Returns
Entity<any>
The entity object with the given ID.
setClass
▸ setClass(type, entity): void
Parameters
| Name | Type |
|---|---|
type | string |
entity | (id: string) => Entity<any> | (id: string) => Entity<any> |
Returns
void
setOnRequestMetadata
▸ setOnRequestMetadata(isWanted): void
Receive the world's on-request entity metadata keys, or stop. A world keeps metadata only a debug view reads (and that changes every tick) out of every client's updates unless asked; ask while such a view is shown. Kept across reconnects: a fresh session is asked again.
Parameters
| Name | Type |
|---|---|
isWanted | boolean |
Returns
void
snapAllToTarget
▸ snapAllToTarget(): void
Returns
void
update
▸ update(cameraPos?, renderDistance?): void
Parameters
| Name | Type |
|---|---|
cameraPos? | Vector3 |
renderDistance? | number |
Returns
void