Beast
Defined in: server/api.d.ts:1564
A server-owned tame creature. Every nearby client builds it as the game’s own creature, one client runs its AI, and players care for it with the game’s petting brush and creature feed (see the beastCared event).
Extends
Section titled “Extends”ServerEntity.ServerEntity
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Beast(
id):Beast
Defined in: server/api.d.ts:1569
Wraps a beast entity id without spawning it.
Parameters
Section titled “Parameters”number
Network id of the server entity to wrap.
Returns
Section titled “Returns”Beast
Methods
Section titled “Methods”addHappiness()
Section titled “addHappiness()”addHappiness(
amount):boolean
Defined in: server/api.d.ts:1717
Moves this beast’s happiness, clamped into 0 to 100. Every client moves its copy through the game’s own writer, which fires the gained or lost effect. Read the result from happiness; to assign a value, pass the difference.
Parameters
Section titled “Parameters”amount
Section titled “amount”number
Delta to apply; negative takes happiness away. Rejected at zero or beyond 100 either way.
Returns
Section titled “Returns”boolean
True when the change was accepted and sent.
cancelAbility()
Section titled “cancelAbility()”cancelAbility(
channel?):boolean
Defined in: server/api.d.ts:1867
Ends what react or playAbility started on that channel, on every client’s copy; its AI takes the body back.
Parameters
Section titled “Parameters”channel?
Section titled “channel?”string
The Able channel; default “FullBody”.
Returns
Section titled “Returns”boolean
False when the beast is gone, down or ridden.
capturableFor()
Section titled “capturableFor()”capturableFor(
player):boolean
Defined in: server/api.d.ts:1769
Whether this player may catch the beast: their override, or capturable. Caged beasts still refuse.
Parameters
Section titled “Parameters”player
Section titled “player”The player to ask about.
Returns
Section titled “Returns”boolean
destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:1722
Despawns the beast everywhere.
Returns
Section titled “Returns”void
dismount()
Section titled “dismount()”dismount():
boolean
Defined in: server/api.d.ts:1817
Orders the rider off through the game’s own dismount (beastDismounted “script” follows once they stand), or withdraws a mount the rider’s game has not answered yet (beastMountFailed “cancelled”).
Returns
Section titled “Returns”boolean
False when nobody rides it or was ordered on.
follow()
Section titled “follow()”follow(
target,options?):boolean
Defined in: server/api.d.ts:1805
Walks after the target and keeps about 1.5 m off, until stop() or a new command. With air a flier flies after an airborne or distant target, holding about 4 m behind and 3 m above it, and lands beside it once it is back on the ground nearby. A followed player’s own client runs the beast. beastMoveEnded “targetGone” when the target leaves.
Parameters
Section titled “Parameters”target
Section titled “target”Player | Character | Beast | NPC
Whom to follow.
options?
Section titled “options?”gait (default: beast.gait), teleportBeyond: metres behind the target past which the server puts it beside them (default 60, 0 never), and air (fliers only): take off while the target is airborne or more than 30 m away.
Returns
Section titled “Returns”boolean
False when the beast no longer exists.
kill()
Section titled “kill()”kill(
options?):boolean
Defined in: server/api.d.ts:1844
Runs the game’s death on every client’s copy and leaves the body lying there (or kneeling) until revive() or destroy(). Its rider is put down first, a running command ends as “stopped”, and while it is down it takes no command, rider, care or catch. beastLifeChanged follows. Throws on a bad argument.
Parameters
Section titled “Parameters”options?
Section titled “options?”wounded: take the game’s near-death kneel instead of dying, as its own magical beasts do.
wounded?
Section titled “wounded?”boolean
Returns
Section titled “Returns”boolean
False when the beast no longer exists.
mount()
Section titled “mount()”mount(
player):boolean
Defined in: server/api.d.ts:1830
Puts a player on the beast through the game’s own mount handler: they possess it and ride it with the game’s controls, flight included, and every other player sees them ride. Ends a running command as “stopped”. beastMounted fires once their game has seated them, beastMountFailed when it could not; they get off with the game’s dismount key (beastDismounted). Throws on a bad argument.
Parameters
Section titled “Parameters”player
Section titled “player”The rider; their client runs the beast for the whole ride.
Returns
Section titled “Returns”boolean
False when it cannot start: the beast is not mountable, not alive, already ridden or being caught, or the player is down, already riding, in an animal form, in another world or more than 30 m away.
moveAlong()
Section titled “moveAlong()”moveAlong(
waypoints,options?):boolean
Defined in: server/api.d.ts:1787
Walks the waypoints through the game’s own path following, ending any running command as “replaced”. beastWaypoint fires on each arrival (before its wait), beastMoveEnded at the end. Throws on bad input.
Parameters
Section titled “Parameters”waypoints
Section titled “waypoints”1 to 64 points, each a player’s origin (as player.position) with an optional wait (seconds), the gait of the leg that arrives there, and air (fliers only).
options?
Section titled “options?”gait (default: beast.gait), loop (“once”, “loop” or “pingpong”) and then (“relax”, “wander” or “stand”, the idle after a “once” path; default “stand”).
Returns
Section titled “Returns”boolean
False when the beast no longer exists.
moveTo()
Section titled “moveTo()”moveTo(
x,y?,z?,options?):boolean
Defined in: server/api.d.ts:1797
moveAlong with one waypoint.
Parameters
Section titled “Parameters”number | Vector3Like
World x of a player’s origin.
number
World y.
number
World z.
options?
Section titled “options?”BeastMoveOptions & object
As moveAlong’s; air flies there (fliers only).
Returns
Section titled “Returns”boolean
False when the beast no longer exists.
pause()
Section titled “pause()”pause():
void
Defined in: server/api.d.ts:1774
Holds the current command (or an idle beast) still in the game’s cinematic wait; resume() continues it. A new command or stop() ends the hold.
Returns
Section titled “Returns”void
playAbility()
Section titled “playAbility()”playAbility(
classPath,channel?,seconds?):boolean
Defined in: server/api.d.ts:1860
Plays an Able ability on every client’s copy of the beast, as react does for the named ones. One that loops holds its channel until seconds have passed or cancelAbility. Throws on a path that is not an ability class path.
Parameters
Section titled “Parameters”classPath
Section titled “classPath”string
An Able ability class path ending ‘_C’, e.g. ‘/Game/Pawn/NPC/Creature/Abilities/ABL_Creature_Upset.ABL_Creature_Upset_C’.
channel?
Section titled “channel?”string
The Able channel; default “FullBody”.
seconds?
Section titled “seconds?”number
Ends it after this long, 0 to 600; 0 (default) lets it run.
Returns
Section titled “Returns”boolean
False when the beast is gone, down or ridden.
react()
Section titled “react()”react(
name):boolean
Defined in: server/api.d.ts:1851
Plays one of the game’s own creature reactions on every client’s copy: the beast’s AI steps aside for it and carries on after. Throws a RangeError for an unknown name.
Parameters
Section titled “Parameters”One of Beast.reactions().
Returns
Section titled “Returns”boolean
False when the beast is gone, down or ridden.
resume()
Section titled “resume()”resume():
void
Defined in: server/api.d.ts:1779
Continues the command pause() held, from where it stopped.
Returns
Section titled “Returns”void
revive()
Section titled “revive()”revive():
boolean
Defined in: server/api.d.ts:1823
Brings a wounded or dead beast back: every copy stands up and its AI runs again. beastLifeChanged follows.
Returns
Section titled “Returns”boolean
False when the beast no longer exists.
setCapturableFor()
Section titled “setCapturableFor()”setCapturableFor(
player,value):boolean
Defined in: server/api.d.ts:1763
Overrides capturable for one player, on their client too, so their Nab-Sack refuses or allows the beast before a catch starts. Dropped when the player leaves.
Parameters
Section titled “Parameters”player
Section titled “player”The player the setting is for.
boolean | null
Whether that player may catch it; null returns them to capturable.
Returns
Section titled “Returns”boolean
False when the beast or player is gone.
setPassenger()
Section titled “setPassenger()”setPassenger(
player):boolean
Defined in: server/api.d.ts:1837
Seats a second player behind the rider of a ridden beast, on every client: they ride along in the rider’s seat pose, cannot walk, and leave with the rider, when they die or disconnect, or when a script passes null (bind a key for it; a passenger put down in flight falls). beastMounted and beastDismounted fire with seat “passenger”. Throws on a bad argument.
Parameters
Section titled “Parameters”player
Section titled “player”Player | null
Who sits behind the rider; null takes the passenger off.
Returns
Section titled “Returns”boolean
False when refused (nobody rides the beast, the seat is taken, or the player is the rider, down, already riding, in an animal form, in another world or more than 30 m away), or when null found no passenger.
setScale()
Section titled “setScale()”setScale(
scale):void
Defined in: server/api.d.ts:1710
Sets the uniform actor scale on every client’s copy of the beast.
Parameters
Section titled “Parameters”number
Uniform actor scale (1 = native size).
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world,map?):void
Defined in: server/api.d.ts:1879
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.
Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”void
setVisibleTo()
Section titled “setVisibleTo()”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.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop(
then?):void
Defined in: server/api.d.ts:1811
Ends the running command as “stopped” and holds the beast there.
Parameters
Section titled “Parameters”"stand" | "relax" | "wander"
The idle to take up (it becomes beast.idle); default “stand”.
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:1704
Returns a debug string for this beast.
Returns
Section titled “Returns”string
bagOf()
Section titled “bagOf()”
staticbagOf(player):CapturedBeast[]
Defined in: server/api.d.ts:1728
The beasts in a player’s bag: their catches this connection and whatever giveCaptured put there. The bag belongs to the connection; save it yourself (beastCaptured, beastReleased) and give it back on join.
Parameters
Section titled “Parameters”player
Section titled “player”Whose bag.
Returns
Section titled “Returns”catalog()
Section titled “catalog()”
staticcatalog():BeastSpeciesInfo[]
Defined in: server/api.d.ts:1755
Every species Beast.create accepts: the 13 nurturable adults and their young, each with whether it flies and can be ridden, its colors, their spawn weights, and whether a color is an effect rather than a coat.
Returns
Section titled “Returns”create()
Section titled “create()”
staticcreate(species,opts?):Beast
Defined in: server/api.d.ts:1750
Spawns a tame native beast. Throws on an unknown species or a color the species does not have.
Parameters
Section titled “Parameters”species
Section titled “species”The game’s species id; Beast.catalog() lists them.
Spawn options; every field is optional.
Returns
Section titled “Returns”Beast
giveCaptured()
Section titled “giveCaptured()”
staticgiveCaptured(player,beast):CapturedBeast|null
Defined in: server/api.d.ts:1736
Puts a beast in a player’s bag, as the game’s own bag record, without the catch notification. Throws on an unknown species, a color the species does not have, a bad gender, or a name over 64 bytes.
Parameters
Section titled “Parameters”player
Section titled “player”Whose bag.
The beast; an omitted color is rolled on the game’s own weights.
Returns
Section titled “Returns”CapturedBeast | null
The bag entry, or null when the player is not connected.
reactions()
Section titled “reactions()”
staticreactions():BeastReaction[]
Defined in: server/api.d.ts:1872
The names beast.react accepts.
Returns
Section titled “Returns”takeCaptured()
Section titled “takeCaptured()”
statictakeCaptured(player,id):boolean
Defined in: server/api.d.ts:1743
Takes a beast out of a player’s bag, in their game too. False when the bag holds no such entry.
Parameters
Section titled “Parameters”player
Section titled “player”Whose bag.
number
The bag entry’s id.
Returns
Section titled “Returns”boolean
Properties
Section titled “Properties”aiPaused
Section titled “aiPaused”aiPaused:
boolean
Defined in: server/api.d.ts:1644
Holds the whole AI in the game’s cinematic wait, across commands, until set false; the beast stands and idles. Like NPC.aiPaused.
area: {
radius:number;x:number;y:number;z:number; } |null
Defined in: server/api.d.ts:1674
Keeps it idling inside a sphere (a player’s origin and a radius in cm): the game picks idle destinations inside it, and the beast walks back if it ends up outside. Commands are not clipped by it. Null clears it.
byproduct
Section titled “byproduct”byproduct:
number|null
Defined in: server/api.d.ts:1629
A vivarium beast’s byproduct, 0 to 1 on the game’s own cycle: it fills over 25 minutes, and reaching 1 clears its needs. A player harvests it once both needs are met (beastByproductRequest), which sets it back to 0. Null outside a vivarium, where assigning throws.
caged:
boolean
Defined in: server/api.d.ts:1614
Refused by the Nab-Sack as caged (“Caged beasts cannot be rescued”), for everyone, whatever capturable says. Changes nothing else about the beast.
capturable
Section titled “capturable”capturable:
boolean
Defined in: server/api.d.ts:1609
Whether players may catch it with the Nab-Sack, unless setCapturableFor says otherwise for one of them. False by default. A player who may not is refused by the Nab-Sack itself (“This beast cannot be rescued”).
readonlycolor:string
Defined in: server/api.d.ts:1589
Color variation, one of the species’ catalogued colors, identical on every client.
gait:
MoveGait
Defined in: server/api.d.ts:1669
The gait follow() and moveAlong() use when their options name none; a running command keeps its own. The species’ own walk, jog and sprint speeds; default “walk”.
gender
Section titled “gender”
readonlygender:"male"|"female"|undefined
Defined in: server/api.d.ts:1584
The beast’s native creature gender, or undefined once the beast has despawned.
happiness
Section titled “happiness”
readonlyhappiness:number
Defined in: server/api.d.ts:1604
Happiness, 0 to 100, held by the server. Accepted care adds the game’s 11; every client’s copy follows this value.
readonlyid:number
Defined in: shared.d.ts:65
Network id, stable for the entity’s lifetime.
idle:
BeastIdle
Defined in: server/api.d.ts:1664
What it does with no command: “relax” (stays near where it was put, sitting and lying; the default), “wander” (explores, grazes and rests around its area) or “stand”.
readonlylife:BeastLife
Defined in: server/api.d.ts:1694
“alive”, “wounded” (the game’s near-death kneel) or “dead” (see kill and revive).
mountable
Section titled “mountable”
readonlymountable:boolean
Defined in: server/api.d.ts:1679
Whether the game can seat a rider on it: a Hippogriff, Thestral or Graphorn, full grown and not living in a vivarium.
movement
Section titled “movement”
readonlymovement:BeastMovementState
Defined in: server/api.d.ts:1654
The running command: mode (“idle”, “path” or “follow”), the waypoint it heads for or waits at, the path’s length, completed laps, whether pause() or aiPaused holds it, the followed entity’s id (0 otherwise), and whether it is airborne now. The idle state once the beast is gone.
readonlyname:string
Defined in: server/api.d.ts:1579
Custom native creature name, or empty when the localized species name is used.
needs: {
fed:boolean;petted:boolean; } |null
Defined in: server/api.d.ts:1639
A vivarium beast’s needs this cycle, met by the creature feed and the petting brush, each once until the byproduct fills. Assigning sets the fields given. Null outside a vivarium, where assigning throws.
ownerId
Section titled “ownerId”
readonlyownerId:number
Defined in: server/api.d.ts:1594
Network id of the player whose client advances the native AI (0 while dormant).
passenger
Section titled “passenger”
readonlypassenger:Player|null
Defined in: server/api.d.ts:1689
The player seated behind the rider (setPassenger), or null.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:1649
Authoritative world-space position. Assigning it teleports the beast on every client and ends a running command as “stopped”.
pregnancy
Section titled “pregnancy”
readonlypregnancy: {endsIn:number;father:Beast|null;pen:number;stage:"gestation"|"incubation"; } |null
Defined in: server/api.d.ts:1634
A vivarium mother’s pregnancy: gestation, then for an egg-layer incubation, the pen, the father and the seconds left in the stage. Null for any other beast.
readonlyrider:Player|null
Defined in: server/api.d.ts:1684
The player riding it, once their game has seated them, or null.
readonlyroom:string|null
Defined in: server/api.d.ts:1624
The Room of Requirement whose vivarium it lives in, or null.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: shared.d.ts:69
Reads as a quaternion; assignments also accept Euler angles in degrees.
readonlyscale:number
Defined in: server/api.d.ts:1599
Current uniform actor scale (1 = native size).
species
Section titled “species”
readonlyspecies:BeastSpecies
Defined in: server/api.d.ts:1574
The game’s species id, e.g. “Hippogriff” or “NifflerOffspring”.
readonlystate: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.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:1699
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.
vivarium
Section titled “vivarium”
readonlyvivarium:"Forest"|"Swamp"|"Coastal"|"Grassland"|null
Defined in: server/api.d.ts:1619
The vivarium of a Room of Requirement it lives in (see Sanctuary.beasts), or null for a beast in the world.
waypoints
Section titled “waypoints”
readonlywaypoints:BeastWaypoint[]
Defined in: server/api.d.ts:1659
The running path’s points as given (gait resolved from the path’s default); empty when idle or following.