EventMap
Defined in: client/api.d.ts:7
Native events dispatched through Events.on. Each property is the exact callback argument tuple for that event.
Properties
Section titled “Properties”bookClosed
Section titled “bookClosed”bookClosed: [
number,"script"|"player"|"sessionOver"|"failed"]
Defined in: client/api.d.ts:100
Dispatched when a book leaves the player’s hands, on this machine only. reason is player for the player’s own exit (or the game ending the reading itself), script for Book.close, failed for a book that never reached the hands, and sessionOver for the session ending. Handler promises are not awaited, and a handler may open the next book straight away.
bookOpened
Section titled “bookOpened”bookOpened: [
number]
Defined in: client/api.d.ts:95
Dispatched when a book Book.open asked for is in the player’s hands and showing its first page, on this machine only.
browserConsoleMessage
Section titled “browserConsoleMessage”browserConsoleMessage: [
BrowserConsoleMessageEvent]
Defined in: client/api.d.ts:185
Dispatched for console output of an owned view; the framework logs these regardless.
browserCreated
Section titled “browserCreated”browserCreated: [
BrowserCreatedEvent]
Defined in: client/api.d.ts:135
Dispatched once per view, before any navigation, to the resource that created it.
browserCursorChange
Section titled “browserCursorChange”browserCursorChange: [
BrowserCursorChangeEvent]
Defined in: client/api.d.ts:165
Dispatched when an owned view’s requested cursor shape changes.
browserDocumentReady
Section titled “browserDocumentReady”browserDocumentReady: [
BrowserDocumentReadyEvent]
Defined in: client/api.d.ts:145
Dispatched when an owned view’s main document is ready; the earliest point at which the page can receive Web.emit.
browserInputFocusChange
Section titled “browserInputFocusChange”browserInputFocusChange: [
BrowserInputFocusChangeEvent]
Defined in: client/api.d.ts:175
Dispatched when focus enters or leaves an editable element of an owned view; use it to stop routing keys to the game.
browserLoadingFailed
Section titled “browserLoadingFailed”browserLoadingFailed: [
BrowserLoadingFailedEvent]
Defined in: client/api.d.ts:150
Dispatched when a frame of an owned view fails to load.
browserLoadingStart
Section titled “browserLoadingStart”browserLoadingStart: [
BrowserLoadingStartEvent]
Defined in: client/api.d.ts:140
Dispatched when any frame of an owned view begins loading.
browserNavigate
Section titled “browserNavigate”browserNavigate: [
BrowserNavigateEvent]
Defined in: client/api.d.ts:155
Dispatched for every navigation an owned view is asked to perform, refused or not.
browserOriginChange
Section titled “browserOriginChange”browserOriginChange: [
BrowserOriginChangeEvent]
Defined in: client/api.d.ts:190
Dispatched on view creation and whenever Web.loadURL re-locks an owned view to a different origin.
browserPopup
Section titled “browserPopup”browserPopup: [
BrowserPopupEvent]
Defined in: client/api.d.ts:160
Dispatched when an owned view blocks a popup; windowless views cannot host one, so handle the URL yourself.
browserResourceBlocked
Section titled “browserResourceBlocked”browserResourceBlocked: [
BrowserResourceBlockedEvent]
Defined in: client/api.d.ts:180
Dispatched when an owned view rejects a navigation or a page event from outside its locked origin.
browserTooltip
Section titled “browserTooltip”browserTooltip: [
BrowserTooltipEvent]
Defined in: client/api.d.ts:170
Dispatched when an owned view requests a tooltip; windowless rendering draws none, so the script must.
characterCreatorClosed
Section titled “characterCreatorClosed”characterCreatorClosed: [
Appearance|null,"replaced"|"unavailable"|"interrupted"|"accepted"|"cancelled"|"closed"]
Defined in: client/api.d.ts:115
Dispatched once for every creator, on this machine only, whatever ended it. appearance is the look the player accepted, and null for every other ending. reason is accepted, cancelled for the player backing out, closed for CharacterCreator.close, replaced for another CharacterCreator.open, unavailable when the stage could not be put up, and interrupted when the session or the body went away under it. Nothing is put on the body: send the look wherever it should go – Events.emitServer, then player.setAppearance on the server – or open the next creator straight from the handler.
entityStateChange
Section titled “entityStateChange”entityStateChange: [
Entity,string,any,any]
Defined in: client/api.d.ts:130
Dispatched when one key of an entity’s state changes: on the server when a script writes it, on a client when the write arrives. value is undefined when the key was removed and previous is undefined when it held nothing before, so a stored null stays distinguishable from an absent key. The entity is whatever the game’s WrapScriptEntity answers, and the base Entity handle by default.
followStarted
Section titled “followStarted”followStarted: [
FollowTarget]
Defined in: client/api.d.ts:105
The local native follow action has entered. A successful start request may still fail before this event.
followStopped
Section titled “followStopped”followStopped: [
FollowTarget,"input"|"script"|"failed"|"targetLost"|"mountChanged"|"teleported"|"unavailable"|"interrupted"|"resourceStopped"|"sessionEnded"|"worldChanged"]
Defined in: client/api.d.ts:110
A queued or active scripted follow ended on this client.
mapClosed
Section titled “mapClosed”mapClosed: []
Defined in: client/api.d.ts:73
Dispatched when the map screen goes away.
mapOpened
Section titled “mapOpened”mapOpened: []
Defined in: client/api.d.ts:68
Dispatched when the map screen comes up at this machine.
mapWaypointCleared
Section titled “mapWaypointCleared”mapWaypointCleared: [
Vector3,number]
Defined in: client/api.d.ts:83
Dispatched when the player takes their marker off the map, including through WorldMap.clearWaypoint. It carries where the marker was, since afterwards nothing says.
mapWaypointSet
Section titled “mapWaypointSet”mapWaypointSet: [
Vector3,number,boolean]
Defined in: client/api.d.ts:78
Dispatched when the player drops their own marker on the map, or moves the one already down – moved separates the two, because the game uses one action for both. The position is world-space metres. Maps reuse one coordinate range, which is why mapId travels with it.
monologueSuppressed
Section titled “monologueSuppressed”monologueSuppressed: [
string,string]
Defined in: client/api.d.ts:43
Dispatched when a monologue line of the local character – a photo-mode comment, the sharpening remark – was kept silent and unsubtitled. text is localized; textKey is its localization key. Not raised while Hud.setMonologueEnabled(true) has released it. Handler promises are not awaited.
noclipChanged
Section titled “noclipChanged”noclipChanged: [
boolean,"script"|"sessionOver"|"mapEditor"|"viewLost"]
Defined in: client/api.d.ts:90
Dispatched when the flight starts and when it ends, on this machine only. Handler promises are not awaited.
reason is script on the way in. On the way out it is script for a resource ending it, mapEditor for the map editor taking the one camera, viewLost for the level going away underneath the camera’s anchor, and sessionOver for the session ending.
playerReady
Section titled “playerReady”playerReady: [
Player]
Defined in: client/api.d.ts:13
Dispatched once per session, when the local player can play: the session is established and the game has taken its own loading screen down. The game raises that moment itself – it is its own gameplay-start signal, not a guess from timing.
Resources are running long before this, so it is not the moment a resource may start listening; it is the moment the player is looking at the world. Put what the player should see on arrival here – a welcome, a first page – rather than in resourceStart, which runs behind the loading screen. The server raises its own playerReady for this player right after.
poiDiscovered
Section titled “poiDiscovered”poiDiscovered: [
LocationId]
Defined in: client/api.d.ts:63
Dispatched after an accepted silent POI discovery. Handler promises are not awaited. Unchanged statuses emit nothing.
progressionLevelUp
Section titled “progressionLevelUp”progressionLevelUp: [
string,number,number]
Defined in: client/api.d.ts:23
Dispatched when a track of the local player’s reaches a new level. perkPoints is what that track’s tree now has unspent.
progressionPerkAdded
Section titled “progressionPerkAdded”progressionPerkAdded: [
string]
Defined in: client/api.d.ts:28
Dispatched when the local player gained a perk: learnt on the perk screen and granted by the server, given by a server resource, or granted by the game on its own.
progressionPerkRefused
Section titled “progressionPerkRefused”progressionPerkRefused: [
string,"script"|"points"|"level"|"parent"|"exclusive"|"blocked"|"owned"|"hidden"]
Defined in: client/api.d.ts:38
Dispatched when the server turned down a perk the local player confirmed on the perk screen. The game’s own screen says nothing when that happens, so this is where a resource tells the player why.
progressionPerkRemoved
Section titled “progressionPerkRemoved”progressionPerkRemoved: [
string]
Defined in: client/api.d.ts:33
Dispatched when the local player lost a perk.
progressionXpGained
Section titled “progressionXpGained”progressionXpGained: [
string,number]
Defined in: client/api.d.ts:18
Dispatched when the local player’s XP on a track went up: after the server granted a gain and the game applied it, with its own multipliers. xp is what landed, in the game’s own units.
questTrackingChanged
Section titled “questTrackingChanged”questTrackingChanged: [
string,boolean]
Defined in: client/api.d.ts:48
Dispatched when this player starts or stops following a server quest in the game’s journal, whichever way it happened: the track button, the game auto-tracking a quest that turns active, or the untrack that follows finishing or failing one. Local to this machine and raised before the server is told; the server raises its own questTrackingChanged when the report arrives. Repeats are filtered, so it only fires on an actual change. Handler promises are not awaited.
resourceStart
Section titled “resourceStart”resourceStart: [
string]
Defined in: client/api.d.ts:120
Dispatched after a resource entry point has run and immediately before the resource becomes running.
resourceStop
Section titled “resourceStop”resourceStop: [
string]
Defined in: client/api.d.ts:125
Dispatched while a resource is stopping, before its stop callback, timers, exports and event handlers are cleaned up.
vendorClosed
Section titled “vendorClosed”vendorClosed: [
number,"player"|"server"|"replaced"|"levelChange"|"sessionOver"]
Defined in: client/api.d.ts:58
Dispatched when a trade screen that vendorOpened announced goes away: the player closed it, the server closed it, the server opened another vendor over it, the level changed under it, or the connection ended. A screen that never came up raises neither event. The server raises its own vendorClosed for the session.
vendorOpened
Section titled “vendorOpened”vendorOpened: [
number,number|null]
Defined in: client/api.d.ts:53
Dispatched when the game’s trade screen actually comes up on this machine for a server vendor – not when the server asked for it, which can take a few frames or fail. npc is the network ID of the NPC keeping the shop, or null when nobody does. Every vendorOpened is followed by exactly one vendorClosed.