Entity
Defined in: server/api.d.ts:8755
Base handle for a live replicated network entity.
Extended by
Section titled “Extended by”HorseDogPropCartVfxMarkerBlipNpcQuestGroundItemDoorGateSiegeEngineSiegeLadderStonePileStashBasePlayer
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Entity(
id):Entity
Defined in: server/api.d.ts:8760
Creates a script wrapper for an existing entity with this ID; it does not spawn an entity.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Entity
Methods
Section titled “Methods”setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:8797
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
Returns
Section titled “Returns”void
setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: server/api.d.ts:8803
Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:8791
Formats this entity handle for logging and debugging.
Returns
Section titled “Returns”string
Text containing the network entity ID.
Properties
Section titled “Properties”
readonlyid:number
Defined in: server/api.d.ts:8765
Immutable network entity identifier.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:8775
Authoritative world-space position; assignment forces replicated state.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: server/api.d.ts:8780
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
readonlystate:StateBag
Defined in: server/api.d.ts:8785
Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:8770
Current virtual-world identifier.