Skip to content
M2O Scripting APIScripting reference
Runtime classClient APIGenerated

Entity

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

Base handle for a live replicated network entity.

new Entity(id): Entity

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

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

number

Network entity identifier.

Entity

setVirtualWorld(world): void

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

Moves this entity into another virtual world.

number

Virtual-world identifier used to partition replication and visibility.

void


setVisibleTo(player): void

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

Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.

Entity | null

Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.

void


toString(): string

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

Formats this entity handle for logging and debugging.

string

Text containing the network entity ID.

readonly id: number

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

Immutable network entity identifier.


position: Vector3

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

Authoritative world-space position; assignment forces replicated state.


rotation: Vector3 | Quaternion

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

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


readonly virtualWorld: number

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

Current virtual-world identifier.