Npc
Defined in: server/api.d.ts:4440
A server-owned NPC: spawned by a resource, simulated by whichever client is nearest.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Npc(
id):Npc
Defined in: server/api.d.ts:4445
Creates a script wrapper for an existing NPC with this ID; use Npc.create() to spawn one.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Npc
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”attack()
Section titled “attack()”attack(
target,options?):boolean
Defined in: server/api.d.ts:4651
Orders native combat against a live player or NPC in the same visible world within 128 metres. Another order stops it. The order fails when its target dies, disappears or leaves that range. It waits while dormant; no offline damage is simulated. Bow attacks stop within 18 metres and use native projectiles. Equipped NPC arrows are replenished while shooting.
Parameters
Section titled “Parameters”target
Section titled “target”number | Player | Npc
The combatant to pursue and attack.
options?
Section titled “options?”Defaults to melee. Bow requires an equipped bow and compatible arrows.
weapon?
Section titled “weapon?”"melee" | "bow"
Returns
Section titled “Returns”boolean
True when accepted. Invalid targets leave the previous order unchanged.
damage()
Section titled “damage()”damage(
amount,attacker?):void
Defined in: server/api.d.ts:4754
Takes health off the ledger, raising npcDamage and, if it is the last of it, npcDeath. Refused for an invulnerable or already-dead body.
Parameters
Section titled “Parameters”amount
Section titled “amount”number
Health to take off.
attacker?
Section titled “attacker?”number | Player
Who did it, for the events this raises.
Returns
Section titled “Returns”void
flee()
Section titled “flee()”flee(
from,options?):boolean
Defined in: server/api.d.ts:4667
Sends the NPC straight away from a place until the requested distance separates them. If the body reports blocked, a loaded mesh lets the server try a route to a point past that distance, on the ground at the NPC’s own height, before reporting it.
Parameters
Section titled “Parameters”What to run away from.
options?
Section titled “options?”radius is how far away is far enough; speed is the pace, run by default.
radius?
Section titled “radius?”number
speed?
Section titled “speed?”"walk" | "jog" | "run"
Returns
Section titled “Returns”boolean
True when the order went out.
follow()
Section titled “follow()”follow(
target,options?):boolean
Defined in: server/api.d.ts:4659
Keeps the NPC near somebody as they move, steering straight at them. npcIntentDone reports reached the first time it catches up, and the follow carries on. If the body reports blocked, a loaded mesh lets the server route to the target’s current position before reporting it. After recovery it resumes following the moving target.
Parameters
Section titled “Parameters”target
Section titled “target”number | Player | Npc
Who to follow, as a handle or a network ID.
options?
Section titled “options?”radius is how close it tries to stay, in metres; speed is the pace.
radius?
Section titled “radius?”number
speed?
Section titled “speed?”"walk" | "jog" | "run"
Returns
Section titled “Returns”boolean
True when the order went out.
getAnimalLoot()
Section titled “getAnimalLoot()”getAnimalLoot():
AnimalLootItem[] |null
Defined in: server/api.d.ts:4604
Returns game-data loot candidates for this animal. Does not roll or populate stock. The gamemode chooses chances and writes Inventory.set at spawn. Null for non-animals, excluded souls or unresolved adopted bodies; an empty array is a known empty preset.
Returns
Section titled “Returns”AnimalLootItem[] | null
getInventory()
Section titled “getInventory()”getInventory():
InventoryState|null
Defined in: server/api.d.ts:4609
Reads server-owned stock and worn row counts. Inventory.get/add/remove/setProperties/set/transfer also accept Npc handles. Default native stock becomes ready at npcInventoryReady; Inventory.set may provide it before a body exists.
Returns
Section titled “Returns”InventoryState | null
getNametagColor()
Section titled “getNametagColor()”getNametagColor():
number
Defined in: server/api.d.ts:4593
Reads this NPC’s nametag color.
Returns
Section titled “Returns”number
Packed 0xAARRGGBB color; opaque white when untinted.
getNametagText()
Section titled “getNametagText()”getNametagText():
string
Defined in: server/api.d.ts:4581
Reads this NPC’s nametag text override.
Returns
Section titled “Returns”string
The override, or an empty string when the NPC’s name is drawn.
hold()
Section titled “hold()”hold():
void
Defined in: server/api.d.ts:4619
Cancels whatever it was doing and leaves it standing where it is.
Returns
Section titled “Returns”void
isNametagHealthVisible()
Section titled “isNametagHealthVisible()”isNametagHealthVisible():
boolean
Defined in: server/api.d.ts:4569
Checks whether the health bar under this NPC’s nametag is shown.
Returns
Section titled “Returns”boolean
True unless the health bar was hidden.
isNametagVisible()
Section titled “isNametagVisible()”isNametagVisible():
boolean
Defined in: server/api.d.ts:4557
Checks whether this NPC’s nametag is drawn; the same switch as the nametag property.
Returns
Section titled “Returns”boolean
True while the nametag is shown.
kill()
Section titled “kill()”kill(
attacker?):void
Defined in: server/api.d.ts:4760
Kills it outright, through the same path damage takes – including an invulnerable one, which is the difference between this and damage.
Parameters
Section titled “Parameters”attacker?
Section titled “attacker?”number | Player
Who to credit with it.
Returns
Section titled “Returns”void
lookAt()
Section titled “lookAt()”lookAt(
target):boolean
Defined in: server/api.d.ts:4674
Turns the NPC’s head, and its body when it has to, without moving it.
Parameters
Section titled “Parameters”target
Section titled “target”number | Player | Npc | Vector3 | Partial<Vector3>
Who or what to look at.
Returns
Section titled “Returns”boolean
True when the order went out.
moveTo()
Section titled “moveTo()”moveTo(
position,options?):boolean
Defined in: server/api.d.ts:4633
Moves to position, cancels any patrol, and emits npcIntentDone once when the move ends.
The game’s own movement steers a body straight at the point it is given and finds no way around anything, so routes come from the server’s navigation mesh. The server plans the route and hands the simulating client one corner at a time, the next before the body reaches the last, so it walks through bends without stopping; a dormant NPC is walked along the same route by the server. Routes only use doorways whose door stands open.
auto (the default) routes on the server whenever a mesh is loaded. Without one, a simulating client steers straight at position and a dormant NPC moves in a straight line. game steers straight at position and waits while dormant; if the body reports blocked and a mesh is loaded, the server tries a route before emitting npcIntentDone. server always routes on the server and throws without a loaded mesh, preserving the previous order.
A missing or partial route ends with blocked, and a blocked route is not retried. Route plans are queued and spread over ticks; the move reads running meanwhile.
Parameters
Section titled “Parameters”position
Section titled “position”Where to walk to.
options?
Section titled “options?”speed defaults to walk; radius is the arrival distance in metres (default 1.5). pathfinding defaults to auto.
pathfinding?
Section titled “pathfinding?”"auto" | "server" | "game"
radius?
Section titled “radius?”number
speed?
Section titled “speed?”"walk" | "jog" | "run"
Returns
Section titled “Returns”boolean
True when the order went out; false for an invalid NPC or destination.
patrol()
Section titled “patrol()”patrol(
points,options?):boolean
Defined in: server/api.d.ts:4643
Walks the waypoints in order. The server stores the route and replicates the current target. npcIntentDone fires once per leg, after its final mesh corner or a movement failure.
A leg that ends blocked or failed is skipped after at least 2 seconds. When every leg of a lap has failed in a row, the patrol is abandoned and that last leg reports failed instead.
Parameters
Section titled “Parameters”points
Section titled “points”string | PatrolRoute | (Vector3 | Partial<Vector3>)[]
Waypoints, a named route handle, or its stable id. Named routes are copied at start.
options?
Section titled “options?”Point arrays retain their defaults: loop, walk, zero wait. Named routes use their authored defaults. Call options override route defaults; waypoint overrides take priority. Use mode for once, loop or pingPong; do not combine mode and loop. radius is the arrival distance. pathfinding uses the moveTo modes for every leg.
boolean
"once" | "loop" | "pingPong"
pathfinding?
Section titled “pathfinding?”"auto" | "server" | "game"
radius?
Section titled “radius?”number
speed?
Section titled “speed?”"walk" | "jog" | "run"
waitSeconds?
Section titled “waitSeconds?”number
Returns
Section titled “Returns”boolean
True when the route was accepted; false for an empty route, more than 256 waypoints, a waypoint that is not finite or lies outside the world, or a waitSeconds that is not a number. Throws if server mode has no loaded mesh, leaving the previous order intact.
pin(
player):void
Defined in: server/api.d.ts:4771
Pins simulation of this NPC to one player’s client, whatever the distances say. What a scripted scene wants: the actor has to be run by the machine the scene is being played to. A pinned NPC goes dormant rather than migrating when that player leaves range, and is unpinned automatically if they disconnect.
Parameters
Section titled “Parameters”player
Section titled “player”number | Player | null
Whose client should run it, or null to hand it back to the election.
Returns
Section titled “Returns”void
playAnimation()
Section titled “playAnimation()”playAnimation(
fragment,options?):boolean
Defined in: server/api.d.ts:4694
Makes the NPC play one of the game’s animations – chopping wood with an axe in hand, drawing water, sitting, drinking – on every client, the one simulating it included. It is state rather than a one-off: a client that streams the NPC in, and the next one to simulate it, play it too, until stopAnimation or the next playAnimation, which both cut it at once.
Give it something to do that keeps it in place, hold or lookAt: an order to walk makes the legs fight a full-body animation. A hit or a fall can cut the animation short; loop starts it again, and keeps a one-shot going pass after pass with no gap.
npcAnimationEnd fires once when the animation this request started is over, and says how.
Parameters
Section titled “Parameters”fragment
Section titled “fragment”string | number
A Mannequin fragment, as Animations.list names it – or, as before, a row of the shipped emote catalog, which plays that gesture once and is not remembered.
options?
Section titled “options?”clip plays a clip the server streams instead of a fragment (animations/kcdc/<resource>/wave.caf, the fragment left ""), tags pick the variant, loop repeats it until stopped, props puts up to two models in its hands. lockMovement does nothing here: an NPC standing still is its intent’s business.
string
lockMovement?
Section titled “lockMovement?”boolean
boolean
props?
Section titled “props?”{ hand?: "right" | "left"; item?: string; joint?: string; model?: string; position?: Vector3 | Partial<Vector3>; rotation?: Vector3 | Partial<Vector3> | Quaternion; } | object[]
string
Returns
Section titled “Returns”boolean
True when the request went out; false for a dead NPC. Throws for a prop or option it cannot use.
remove()
Section titled “remove()”remove():
void
Defined in: server/api.d.ts:4614
Despawns this NPC everywhere, after emitting npcDestroy.
Returns
Section titled “Returns”void
revive()
Section titled “revive()”revive():
void
Defined in: server/api.d.ts:4765
Brings a dead NPC back at full health. Every client makes a fresh body for it, because the one they have is a corpse.
Returns
Section titled “Returns”void
say(
text):boolean
Defined in: server/api.d.ts:4726
Puts a line of speech over the body on every client that can see it.
Parameters
Section titled “Parameters”string
What it says, up to 256 characters.
Returns
Section titled “Returns”boolean
True when the line went out.
setAppearance()
Section titled “setAppearance()”setAppearance(
appearance):boolean
Defined in: server/api.d.ts:4747
Changes the body under the clothes – face, hair, beard and skin. Unlike a player’s, this is a write rather than a request: nobody owns an NPC’s body but the server.
Parameters
Section titled “Parameters”appearance
Section titled “appearance”Partial<Appearance>
The parts to change; anything left out keeps what it is wearing.
Returns
Section titled “Returns”boolean
True when the appearance was accepted.
setFacialExpression()
Section titled “setFacialExpression()”setFacialExpression(
fragment,options?):boolean
Defined in: server/api.d.ts:4711
Sets the NPC’s facial expression on every client, alongside whatever its body plays. It is state: a client that streams the NPC in, and the next one to simulate it, show it too, until the next call.
The expression is the eyes, brows and mood; it never moves the mouth, which is setTalking. A mood tag is one of the body’s own tags, so it can change the mood of its idle too.
Parameters
Section titled “Parameters”fragment
Section titled “fragment”string
A fragment on the face’s own scope: FE_Default, FE_DialogueIdle or FE_DialogueSpeaking for a held mood, or an ADLG_FA_* gesture (ADLG_FA_Smile, ADLG_FA_Wink, ADLG_FA_Laugh, ADLG_FA_Surprise…) that plays once. "" hands the face back to the game.
options?
Section titled “options?”tags pick the variant: for the FE_* fragments the mood, happy, angry, sad, nervous, pensive, arogant or drunk, as Animations.list("FE_") spells them.
string
Returns
Section titled “Returns”boolean
True when the request went out; false for a dead NPC. Throws for an argument it cannot use.
setNametagColor()
Section titled “setNametagColor()”setNametagColor(
color):void
Defined in: server/api.d.ts:4599
Tints the text on this NPC’s nametag.
Parameters
Section titled “Parameters”number
Packed 0xAARRGGBB color.
Returns
Section titled “Returns”void
setNametagHealthVisible()
Section titled “setNametagHealthVisible()”setNametagHealthVisible(
visible):void
Defined in: server/api.d.ts:4575
Shows or hides the health bar under this NPC’s nametag, leaving the name itself alone.
Parameters
Section titled “Parameters”visible
Section titled “visible”boolean
True to show the health bar under this NPC’s name, false to hide it.
Returns
Section titled “Returns”void
setNametagText()
Section titled “setNametagText()”setNametagText(
text?):void
Defined in: server/api.d.ts:4587
Overrides the text drawn on this NPC’s nametag without renaming it: name still reaches conversation and the soul.
Parameters
Section titled “Parameters”string
Text to show instead of the NPC’s name; empty or omitted restores the name.
Returns
Section titled “Returns”void
setNametagVisible()
Section titled “setNametagVisible()”setNametagVisible(
visible):void
Defined in: server/api.d.ts:4563
Shows or hides the name over this NPC’s head for every player; the same switch as the nametag property. Each player can still hide all nametags locally.
Parameters
Section titled “Parameters”visible
Section titled “visible”boolean
True to draw this NPC’s nametag for every player, false to hide it.
Returns
Section titled “Returns”void
setOutfit()
Section titled “setOutfit()”setOutfit(
preset):boolean
Defined in: server/api.d.ts:4740
Dresses the body in one of the game’s own outfits.
Parameters
Section titled “Parameters”preset
Section titled “preset”string
Clothing preset GUID from the game’s own table.
Returns
Section titled “Returns”boolean
True when the preset is one this build has.
setTalking()
Section titled “setTalking()”setTalking(
talking,style?):boolean
Defined in: server/api.d.ts:4719
Moves the NPC’s mouth as if it were talking, on every client, until told to stop. Pair it with say for a line of text. It is a looping talk animation, not lip-sync: it follows no words, and the game’s own lip-sync wins while the NPC speaks a voice line of its own.
Parameters
Section titled “Parameters”talking
Section titled “talking”boolean
Whether the mouth moves.
style?
Section titled “style?”"neutral" | "happy" | "drunk" | "chew"
How: neutral (the default), happy, drunk or chew.
Returns
Section titled “Returns”boolean
True when the request went out; false for a dead NPC. Throws for a style it does not know.
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
Inherited from
Section titled “Inherited from”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
Inherited from
Section titled “Inherited from”stopAnimation()
Section titled “stopAnimation()”stopAnimation(
options?):boolean
Defined in: server/api.d.ts:4701
Ends what playAnimation started at once, takes its props away and hands the body back to its intent. The stand-up standUp asks for is an animation of its own and raises its own npcAnimationEnd.
Parameters
Section titled “Parameters”options?
Section titled “options?”standUp plays the game’s own way back to standing when the animation held the body in a sitting or lying stance tag: StandUp or GetUp, in the variant that fits. Without it the body goes straight back to standing.
standUp?
Section titled “standUp?”boolean
Returns
Section titled “Returns”boolean
True when the request went out.
teleport()
Section titled “teleport()”teleport(
position,rotation?):boolean
Defined in: server/api.d.ts:4682
Moves the body outright, whoever is simulating it. Unlike a player teleport this is a write rather than a request: the server bumps the body’s epoch, so a pose the simulator had already sent cannot put it back.
Parameters
Section titled “Parameters”position
Section titled “position”Where to put it.
rotation?
Section titled “rotation?”Vector3 | Partial<Vector3> | Quaternion
Optional facing; a Quaternion, or Euler angles in degrees.
Returns
Section titled “Returns”boolean
True when the position was usable.
toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:4551
Formats this NPC handle for logging and debugging.
Returns
Section titled “Returns”string
The NPC’s ID, name, intent and last reported status.
Inherited from
Section titled “Inherited from”wear()
Section titled “wear()”wear(
itemClasses):boolean
Defined in: server/api.d.ts:4733
Dresses the body in exactly these items, replacing what it had on. Existing items are reused and missing ones are added to stock. An empty list undresses it and retains its clothes as loose inventory.
Parameters
Section titled “Parameters”itemClasses
Section titled “itemClasses”string[]
Item class GUIDs in the dashed form the game’s own tables spell them.
Returns
Section titled “Returns”boolean
True when every GUID names an item class this build has. Otherwise nothing changes, and each refused GUID is logged.
adopt()
Section titled “adopt()”
staticadopt(levelGuid,options?):Npc
Defined in: server/api.d.ts:4788
Takes over one of the level’s own NPCs instead of spawning a new body. Locomotion is validated as for create. A level EntityGuid is the same number on every machine, so every client finds the same body – which is how doors, gates and stashes are already addressed. Adopting the same guid twice returns the NPC that already has it without applying the options again.
Parameters
Section titled “Parameters”levelGuid
Section titled “levelGuid”number
EntityGuid of the body the level already placed.
options?
Section titled “options?”The same options a spawn takes; soul and class are ignored, since the body already exists.
appearance?
Section titled “appearance?”Partial<Appearance>
class?
Section titled “class?”string
faction?
Section titled “faction?”number
frozen?
Section titled “frozen?”boolean
health?
Section titled “health?”number
interactable?
Section titled “interactable?”boolean
invulnerable?
Section titled “invulnerable?”boolean
locomotion?
Section titled “locomotion?”"native" | "kinematic"
lootable?
Section titled “lootable?”boolean
maxHealth?
Section titled “maxHealth?”number
string
nametag?
Section titled “nametag?”boolean
outfit?
Section titled “outfit?”string
position?
Section titled “position?”rotation?
Section titled “rotation?”Vector3 | Partial<Vector3> | Quaternion
string
virtualWorld?
Section titled “virtualWorld?”number
wearing?
Section titled “wearing?”string[]
Returns
Section titled “Returns”Npc
The NPC handle for that body.
staticall(virtualWorld?):Npc[]
Defined in: server/api.d.ts:4795
Lists every server-owned NPC.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to list; omitted lists every one of them.
Returns
Section titled “Returns”Npc[]
One handle per live NPC, in no particular order.
animals()
Section titled “animals()”
staticanimals():object[]
Defined in: server/api.d.ts:4825
Animal souls with matching native classes. Pass a name or soul to Npc.create. Chickens use flock entities and are excluded.
Returns
Section titled “Returns”object[]
animalSpawnpoints()
Section titled “animalSpawnpoints()”
staticanimalSpawnpoints(level?):object[]
Defined in: server/api.d.ts:4831
Level-authored animal spawners. Positions are markers and must be projected onto navigation. GUIDs are hex strings. Counts and respawn days describe the original game; scripts decide their population and respawn policy.
Parameters
Section titled “Parameters”level?
Section titled “level?”string
Defaults to the running server’s level. Pass * for all levels.
Returns
Section titled “Returns”object[]
create()
Section titled “create()”
staticcreate(options):Npc
Defined in: server/api.d.ts:4780
Spawns an NPC and replicates it. Omitted or undefined locomotion defaults to native; other values must be exactly native or kinematic, otherwise it throws before spawning. It exists on the server from this moment: every client near enough makes a body for it, one of them is elected to run it, and the rest draw what that one reports.
The body is not simulated until somebody is close enough to run it, which is not a failure – a guard on the other side of the map has nothing to do that anybody can see. Read simulator to tell.
Parameters
Section titled “Parameters”options
Section titled “options”soul is a role from Npc.roles(), an animal name from Npc.animals(), or a soul GUID; position is where to put it. Everything else has a default.
appearance?
Section titled “appearance?”Partial<Appearance>
class?
Section titled “class?”string
faction?
Section titled “faction?”number
frozen?
Section titled “frozen?”boolean
health?
Section titled “health?”number
interactable?
Section titled “interactable?”boolean
invulnerable?
Section titled “invulnerable?”boolean
locomotion?
Section titled “locomotion?”"native" | "kinematic"
lootable?
Section titled “lootable?”boolean
maxHealth?
Section titled “maxHealth?”number
string
nametag?
Section titled “nametag?”boolean
outfit?
Section titled “outfit?”string
position?
Section titled “position?”rotation?
Section titled “rotation?”Vector3 | Partial<Vector3> | Quaternion
string
virtualWorld?
Section titled “virtualWorld?”number
wearing?
Section titled “wearing?”string[]
Returns
Section titled “Returns”Npc
The new NPC’s handle.
getById()
Section titled “getById()”
staticgetById(id):Npc|null
Defined in: server/api.d.ts:4802
Looks an NPC up by its network entity ID.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Npc | null
The NPC’s handle, or null when no live NPC has that ID.
placements()
Section titled “placements()”
staticplacements():object[]
Defined in: server/api.d.ts:4820
Authored human NPC placements in the configured level with matching catalog souls. These are initial placements, not current NPC schedules or proof that a quest layer is loaded. Does not spawn or adopt anything.
Returns
Section titled “Returns”object[]
removeAll()
Section titled “removeAll()”
staticremoveAll(virtualWorld?):number
Defined in: server/api.d.ts:4809
Despawns NPCs, emitting npcDestroy for each.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to clear; omitted clears every one of them.
Returns
Section titled “Returns”number
How many were despawned.
roles()
Section titled “roles()”
staticroles():string[]
Defined in: server/api.d.ts:4815
The named kinds of NPC this build ships – guard, bandit, townswoman and the rest. Each is a real soul out of the game’s own tables, so a role spawns a body that already looks the part. Animal names are listed separately by Npc.animals(). Other values are taken as soul GUIDs.
Returns
Section titled “Returns”string[]
The role names.
Properties
Section titled “Properties”actorClass
Section titled “actorClass”
readonlyactorClass:string
Defined in: server/api.d.ts:4455
Native entity class, including NPC, NPC_Female, or the matching animal class from Npc.animals().
readonlyalive:boolean
Defined in: server/api.d.ts:4485
False once health reached zero. A dead NPC is still an entity – it is a corpse, and it can still be looted or revived.
appearance
Section titled “appearance”
readonlyappearance:Appearance
Defined in: server/api.d.ts:4535
The body under the clothes, as the game’s own component names. Write it with setAppearance.
faction
Section titled “faction”faction:
number
Defined in: server/api.d.ts:4470
Faction row used for relationship and crime decisions; 0 is no faction.
frozen
Section titled “frozen”frozen:
boolean
Defined in: server/api.d.ts:4495
Whether the body holds its pose whatever its intent says.
health
Section titled “health”health:
number
Defined in: server/api.d.ts:4475
The server’s ledger of this body’s health, clamped to maxHealth. Combat damage arrives here after the server has agreed to it.
readonlyid:number
Defined in: server/api.d.ts:8765
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”intent
Section titled “intent”
readonlyintent:string
Defined in: server/api.d.ts:4520
What the NPC has been told to do: hold, moveTo, follow, flee, lookAt, playAnim, talk or attack.
interactable
Section titled “interactable”interactable:
boolean
Defined in: server/api.d.ts:4500
Whether clients watch the use key against this body and raise npcInteract. On by default.
invulnerable
Section titled “invulnerable”invulnerable:
boolean
Defined in: server/api.d.ts:4490
Whether damage is refused before it reaches the ledger.
levelGuid
Section titled “levelGuid”
readonlylevelGuid:number
Defined in: server/api.d.ts:4460
EntityGuid of the level body this NPC adopted, or 0 for a spawned one.
locomotion
Section titled “locomotion”locomotion:
"native"|"kinematic"
Defined in: server/api.d.ts:4515
How the client simulator moves the body. native (default) uses the game’s movement controller and walk animations. kinematic moves the body directly without walk animation. Only these exact, case-sensitive strings are accepted; invalid values throw without changing the mode. Neither finds a way around anything: the game’s movement controller steers straight at the point it is given. Routes come from server pathfinding, which hands either mode mesh corners – see moveTo.
lootable
Section titled “lootable”lootable:
boolean
Defined in: server/api.d.ts:4510
Whether its corpse keeps its inventory for whoever searches it.
maxHealth
Section titled “maxHealth”
readonlymaxHealth:number
Defined in: server/api.d.ts:4480
Health the body starts with and is revived to.
name:
string
Defined in: server/api.d.ts:4465
What every client shows over the body and in conversation. Empty leaves the name its soul was born with.
nametag
Section titled “nametag”nametag:
boolean
Defined in: server/api.d.ts:4505
Whether its name is drawn over it the way a player’s is.
patrolState
Section titled “patrolState”
readonlypatrolState:PatrolState|null
Defined in: server/api.d.ts:4525
Current patrol snapshot and progress, or null when not patrolling. Updating a route does not change a running patrol.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:8775
Authoritative world-space position; assignment forces replicated state.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”simulator
Section titled “simulator”
readonlysimulator:Player|null
Defined in: server/api.d.ts:4545
The player whose client is currently running this NPC, or null while it is dormant. Dormant is not broken: nobody is near enough for it to matter, and the server keeps its route advancing until somebody is.
readonlysoul:string
Defined in: server/api.d.ts:4450
GUID of the soul the body was spawned against, or empty for an adopted level body. Read-only: a soul decides what the body is, so a different one is a different NPC.
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.
Inherited from
Section titled “Inherited from”status
Section titled “status”
readonlystatus:string
Defined in: server/api.d.ts:4530
What has become of the current order: idle, running, reached, blocked or failed. A move reads running from the moment it is given – while its route is planned and while it walks the route’s corners – until it ends, and then the outcome npcIntentDone announced, which stays until the next order. A follow reads reached while it is within its radius. Dormant moves in auto or server mode are carried out and decided by the server; dormant game moves wait for a client simulator.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:8770
Current virtual-world identifier.
Inherited from
Section titled “Inherited from”wearing
Section titled “wearing”
readonlywearing:string[]
Defined in: server/api.d.ts:4540
Its worn item classes. Before default stock is established an empty list leaves the soul’s own outfit; afterward empty means undressed. Write it with wear, setOutfit or Inventory.set.