Skip to content
M2O Scripting APIScripting reference
Runtime classClient APIGenerated

Entity

Defined in: client/api.d.ts:3916

Base handle for a live replicated network entity.

new Entity(id): Entity

Defined in: client/api.d.ts:3921

Creates a script wrapper for an existing entity with this ID; it does not spawn an entity.

number

Network entity identifier.

Entity

toString(): string

Defined in: client/api.d.ts:3952

Formats this entity handle for logging and debugging.

string

Text containing the network entity ID.

readonly id: number

Defined in: client/api.d.ts:3926

Immutable network entity identifier.


position: Vector3

Defined in: client/api.d.ts:3936

Authoritative world-space position; assignment forces replicated state.


rotation: Vector3 | Quaternion

Defined in: client/api.d.ts:3941

Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.


readonly state: StateBag

Defined in: client/api.d.ts:3946

Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.


readonly virtualWorld: number

Defined in: client/api.d.ts:3931

Current virtual-world identifier.