Skip to content
ASArcaneMP Scripting APIScripting reference
Runtime classServer APIGenerated

WorldObject

Defined in: server/api.d.ts:2188

A server-owned, interest-streamed world-object handle.

  • ServerEntity.ServerEntity

new WorldObject(id): WorldObject

Defined in: server/api.d.ts:2193

Wraps a world-object entity id without spawning it.

number

Network id of the server entity to wrap.

WorldObject

applyAngularImpulse(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2360

Applies an instantaneous angular impulse in radians.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


applyAngularImpulseDegrees(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2396

applyAngularImpulse with the vector in degrees.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


applyForce(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2333

Applies a force for one physics step; call every tick for a continuous push. False when nobody simulates it.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


applyImpulse(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2342

Applies an instantaneous impulse, optionally at a world point (opts.at).

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


applyTorque(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2351

Applies a torque in radians for one physics step.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


applyTorqueDegrees(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2387

applyTorque with the vector in degrees, the unit the rest of the API uses.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


attachTo(player, socket?): boolean

Defined in: server/api.d.ts:2412

Attaches a physics object to a player’s body on every client. False for a placed (non-physics) object or a missing player.

Player

Carrier; their client becomes the owner.

string

Body mesh socket it rides; the mesh origin when omitted.

boolean


clearMaterialParams(): void

Defined in: server/api.d.ts:2314

Drops every parameter set by setMaterialParam.

void


destroy(): boolean

Defined in: server/api.d.ts:2273

Destroys this world-object entity.

boolean


detach(): boolean

Defined in: server/api.d.ts:2417

Releases a carried physics object where it is. Its carrier keeps simulating it until the election moves it on.

boolean


getAngularVelocity(): Vector3

Defined in: server/api.d.ts:2324

Last simulator-reported angular velocity in rad/s.

Vector3


getLinearVelocity(): Vector3

Defined in: server/api.d.ts:2319

Last simulator-reported velocity in cm/s.

Vector3


getMaterialParams(): WorldObjectMaterialParam[]

Defined in: server/api.d.ts:2309

The parameters set by setMaterialParam, colors as linear { r, g, b, a }.

WorldObjectMaterialParam[]


getMaterials(): Record<number, string>

Defined in: server/api.d.ts:2296

The per-slot materials set by materials or setMaterial, by slot.

Record<number, string>


getScale(): Vector3

Defined in: server/api.d.ts:2278

Scale per axis; a negative axis is mirrored.

Vector3


hasCollisionFor(player): boolean

Defined in: server/api.d.ts:2433

Whether this object blocks the player: false when it was created with collision off or the player has a pass (setCollisionFor).

Player

boolean


setAngularVelocity(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2378

Sets the body’s angular velocity in rad/s.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


setAngularVelocityDegrees(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2405

Sets the body’s angular velocity in degrees/s.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


setCollisionFor(player, enabled): boolean

Defined in: server/api.d.ts:2428

With false, the player walks through this collidable object and the bolts they fire fly through it, on every client; everyone and everything else meets it as before. The pass ends when the player leaves. False for an object created with collision off, a missing player, or a 65th pass.

Player

boolean

false lets the player through; true blocks them again.

boolean


setLinearVelocity(x, y?, z?, opts?): boolean

Defined in: server/api.d.ts:2369

Sets the body’s velocity in cm/s.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


setMaterial(slot, material): boolean

Defined in: server/api.d.ts:2291

Replaces the material of one slot on every client, over the create option material. Meshes only: a Blueprint draws itself. False when 16 slots are already replaced or the object is gone.

number

Material slot 0-63 of the mesh.

string | null

Material asset path (‘/Game/Dir/MI_X.MI_X’); null puts the mesh’s own back.

boolean


setMaterialParam(slot, name, value): boolean

Defined in: server/api.d.ts:2304

Sets one parameter of the slot’s material on every client, through a dynamic instance of whatever material the slot shows. A name the material lacks is ignored. Throws TypeError on a malformed argument; false when 32 parameters are already set or the object is gone.

number

Material slot 0-63, or -1 for every slot.

string

The parameter’s name in the material, e.g. ‘Hue Shift Percentage’.

string | number | WorldObjectColor | null

A number for a scalar parameter; ‘#rrggbb[aa]’ (sRGB) or { r, g, b, a? } (linear) for a vector one; a texture path for a texture one; null drops it.

boolean


setScale(scale, y?, z?): boolean

Defined in: server/api.d.ts:2284

Rescales the object on every client, collision included. Each axis 0.001 to 1000 in size; a negative axis mirrors. Throws RangeError otherwise; false when the object is gone.

number | Vector3

One number for every axis, { x, y, z } (a missing axis is 1), or x when y and z follow.

number

number

boolean


setVelocity(x, y, z): boolean

Defined in: server/api.d.ts:2422

Sets a physics object’s linear velocity (cm/s) on whichever client simulates it.

number

number

number

boolean


setVirtualWorld(world, map?): void

Defined in: server/api.d.ts:2454

Moves this entity into another virtual world, within a map: there it meets the players in the same world of the same map, so world N of a dungeon is one instance of it.

number

Virtual-world identifier used to partition replication and visibility.

string

The map it is in, as player.location().areaId names it; “Overland” or “” for the shared map. Left out, it stays in its current map.

void


setVisibleTo(player): void

Defined in: shared.d.ts:82

Restricts replication to one player’s connection, within the usual range and visibility checks; null lifts it.

Entity | null

void


toString(): string

Defined in: shared.d.ts:74

string


static create(key, model, opts): WorldObject | undefined

Defined in: server/api.d.ts:2441

Creates or replaces an interest-streamed world object. Assigning position or rotation afterwards moves it on every client, interpolated. With motion, each client moves it from the spawn pose along motion.heading, so its server position stays at the spawn point; a client that streams it in mid-run places it where the others see it, and assigning position or rotation ends the run, leaving it at the assigned pose. With ttl, the server destroys it after that many seconds, and each client plays endFx where its copy is when the time runs out. Throws on a malformed path or an out-of-range number.

string

Stable string key; creating again replaces the entity.

string | number

Static or skeletal mesh path (‘/Game/Dir/SM_X.SM_X’), Blueprint class path (‘/Game/Dir/BP_X.BP_X_C’) or catalog model id. Throws if none.

WorldObjectSpawnOptions

Placement, interaction, attached effect and sound, look (scale, animation, material, materials), motion and lifetime (ttl, startFx, endFx, shrinkOut).

WorldObject | undefined


static destroy(key): boolean

Defined in: server/api.d.ts:2447

Destroys the world object stored under a stable key.

string

Stable key passed to create.

boolean

angularDamping: number

Defined in: server/api.d.ts:2238

Angular damping; negative keeps the mesh’s own.


drawDistance: number

Defined in: server/api.d.ts:2248

Client cull distance in cm: players who have the object stop drawing it beyond this. 0 never culls; -1 is the default (a mesh never culls, a Blueprint keeps its own).


frozen: boolean

Defined in: server/api.d.ts:2223

Holds the body in place without turning physics off.


gravity: boolean

Defined in: server/api.d.ts:2218

Whether gravity applies while simulating.


readonly id: number

Defined in: shared.d.ts:65

Network id, stable for the entity’s lifetime.


linearDamping: number

Defined in: server/api.d.ts:2233

Linear damping; negative keeps the mesh’s own.


mass: number

Defined in: server/api.d.ts:2228

Mass override in kg; 0 keeps the mesh’s own.


readonly modelId: number

Defined in: server/api.d.ts:2198

Catalog model id, or 0 when the mesh travels as a path.


readonly modelPath: string

Defined in: server/api.d.ts:2203

Mesh asset path this object renders, whichever form it was created with.


readonly ownerId: number

Defined in: server/api.d.ts:2258

Network id of the player whose client simulates or holds this object (0 = server-held/dormant, or not simulated).


physics: boolean

Defined in: server/api.d.ts:2213

Whether a nearby client simulates this object as a rigid body.


position: Vector3

Defined in: shared.d.ts:67

World position. Read, call set(...), then assign back.


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:69

Reads as a quaternion; assignments also accept Euler angles in degrees.


readonly scale: number

Defined in: server/api.d.ts:2208

Uniform actor scale; the X axis when the axes differ (see getScale).


readonly simulatorId: number

Defined in: server/api.d.ts:2253

Network id of the player whose client simulates this object (0 = nobody).


readonly state: StateBag

Defined in: shared.d.ts:71

This entity’s key/value state: the server writes it, and every client that can see the entity receives it. See StateBag.


streamRange: number

Defined in: server/api.d.ts:2243

Interest radius in cm: only players this close receive the object. Clamped to 100-200000; default 50000 (500 m).


readonly virtualWorld: number

Defined in: server/api.d.ts:2268

The virtual world scripts put this entity in. Outside the shared map (Overland) replication combines it with the entity’s map, as it does a player’s.


static modelCount: number

Defined in: server/api.d.ts:2263

Number of world-object-tagged models in the shared mesh registry.