Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Data shapeClient APIGenerated

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.

activate: [number, number]

Defined in: client/api.d.ts:101

Dispatched when the local player activates a reference: the Activate button, a prompt, a pick-up. ref is the placed reference’s form ID, base its base object’s. It tells of the attempt, which the game may still refuse; a reference with an activate parent raises one for the parent first. To stop an activation, block it beforehand with References.setActivationBlocked or Controls.setEnabled.


browserConsoleMessage: [BrowserConsoleMessageEvent]

Defined in: client/api.d.ts:236

Dispatched for console output of an owned view; the framework logs these regardless.


browserCreated: [BrowserCreatedEvent]

Defined in: client/api.d.ts:186

Dispatched once per view, before any navigation, to the resource that created it.


browserCursorChange: [BrowserCursorChangeEvent]

Defined in: client/api.d.ts:216

Dispatched when an owned view’s requested cursor shape changes.


browserDocumentReady: [BrowserDocumentReadyEvent]

Defined in: client/api.d.ts:196

Dispatched when an owned view’s main document is ready; the earliest point at which the page can receive Web.emit.


browserInputFocusChange: [BrowserInputFocusChangeEvent]

Defined in: client/api.d.ts:226

Dispatched when focus enters or leaves an editable element of an owned view; use it to stop routing keys to the game.


browserLoadingFailed: [BrowserLoadingFailedEvent]

Defined in: client/api.d.ts:201

Dispatched when a frame of an owned view fails to load.


browserLoadingStart: [BrowserLoadingStartEvent]

Defined in: client/api.d.ts:191

Dispatched when any frame of an owned view begins loading.


browserNavigate: [BrowserNavigateEvent]

Defined in: client/api.d.ts:206

Dispatched for every navigation an owned view is asked to perform, refused or not.


browserOriginChange: [BrowserOriginChangeEvent]

Defined in: client/api.d.ts:241

Dispatched on view creation and whenever Web.loadURL re-locks an owned view to a different origin.


browserPopup: [BrowserPopupEvent]

Defined in: client/api.d.ts:211

Dispatched when an owned view blocks a popup; windowless views cannot host one, so handle the URL yourself.


browserResourceBlocked: [BrowserResourceBlockedEvent]

Defined in: client/api.d.ts:231

Dispatched when an owned view rejects a navigation or a page event from outside its locked origin.


browserTooltip: [BrowserTooltipEvent]

Defined in: client/api.d.ts:221

Dispatched when an owned view requests a tooltip; windowless rendering draws none, so the script must.


chatMessage: [object]

Defined in: client/api.d.ts:246

Dispatched for every chat line the server sends. An empty author is a notice line; color is packed 0xRRGGBBAA, 0 for the chat box’s default.


chatSend: [string]

Defined in: client/api.d.ts:251

Dispatched synchronously for a line the player typed into the chat box, before it is sent. A handler returning false, not a Promise of it, blocks it; Chat.send does not raise this.


containerClose: [number]

Defined in: client/api.d.ts:121

Dispatched when the local player closes a container they had open, as its contents go to the server.


containerOpen: [number]

Defined in: client/api.d.ts:116

Dispatched when the local player opens a container’s menu and asks the server for it. The server may still refuse it, while another player holds it.


crosshairChange: [number, number, number | null]

Defined in: client/api.d.ts:21

Dispatched when what lies under the crosshair changes, as the activation prompt follows it: the reference now there and the one before, 0 for none, and, when the new one is another player’s body or an NPC, its network ID as the server knows it.


doorChange: [number, boolean]

Defined in: client/api.d.ts:106

Dispatched when the local player opens or closes a door the session shares, as the server is told. ref is the placed reference’s form ID.


entityStateChange: [Entity, string, any, any]

Defined in: client/api.d.ts:181

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.


inventoryChange: [InventoryDelta[]]

Defined in: client/api.d.ts:96

Dispatched in the frame after items moved into or out of the local player’s inventory, with every count that moved.


itemDrop: [number, number]

Defined in: client/api.d.ts:126

Dispatched when the local player drops items into the world: the base object and how many.


itemPickUp: [number, number]

Defined in: client/api.d.ts:131

Dispatched when the server grants the local player a loose item they picked up: the base object and how many.


levelChange: [number, number]

Defined in: client/api.d.ts:81

Dispatched when the local player’s level changes, from a level-up or the server’s record.


lightning: [number]

Defined in: client/api.d.ts:161

Dispatched when lightning strikes in the sky: a flash and a thunderclap, with the flash’s brightness from 0 to 1. In a session every player’s sky strikes together, on the server’s word.


localPlayerDeath: []

Defined in: client/api.d.ts:26

Dispatched once when the local player goes down. The server decides when they come back.


localPlayerRespawn: []

Defined in: client/api.d.ts:31

Dispatched once when the local player is back up after a death.


lockChange: [number, boolean]

Defined in: client/api.d.ts:111

Dispatched when the local player picks, unlocks or locks a lock the session shares.


menuClose: [string]

Defined in: client/api.d.ts:16

Dispatched when a game menu closes, by its registered name.


menuOpen: [string]

Defined in: client/api.d.ts:11

Dispatched when a game menu opens, by its registered name, such as “PipboyMenu” or “ContainerMenu”.


outfitChange: [OutfitPiece[]]

Defined in: client/api.d.ts:51

Dispatched when what the local player wears changes; outfit is all of it.


perkChange: [number, boolean]

Defined in: client/api.d.ts:86

Dispatched when the local player’s game adds a perk rank (the chart, a magazine, a quest) or takes one away. perk is the rank’s BGSPerk form ID.


pipboyLightToggle: [boolean]

Defined in: client/api.d.ts:66

Dispatched when the local player turns the Pip-Boy light on or off with its key. LocalPlayer.setPipboyLight does not raise it.


powerArmorChange: [boolean]

Defined in: client/api.d.ts:41

Dispatched once when the local player gets into a power armor frame (entered) and once when they get out.


resourceStart: [string]

Defined in: client/api.d.ts:171

Dispatched after a resource entry point has run and immediately before the resource becomes running.


resourceStop: [string]

Defined in: client/api.d.ts:176

Dispatched while a resource is stopping, before its stop callback, timers, exports and event handlers are cleaned up.


spaceChange: [PlayerSpace, PlayerSpace]

Defined in: client/api.d.ts:36

Dispatched when the local player moves into another worldspace or interior cell.


valueChange: [number, number]

Defined in: client/api.d.ts:91

Dispatched when the local player’s game moves the base of a SPECIAL value: a bobblehead, the SPECIAL menu. value is the ActorValueInfo form ID.


voiceStart: []

Defined in: client/api.d.ts:256

Dispatched when the local player starts speaking, as isTalking turns true.


voiceStop: []

Defined in: client/api.d.ts:261

Dispatched when the local player stops speaking, as isTalking turns false.


weaponAttack: [string]

Defined in: client/api.d.ts:61

Dispatched when the local player swings a melee weapon or their fists, or bashes with a gun: event is the animation event their game took (meleeattackStart, bashStart…). Shots are weaponFire. The server hears the same as playerAttack.


weaponChange: [PlayerWeapon | null]

Defined in: client/api.d.ts:46

Dispatched when the weapon in the local player’s hands changes, its mods or ammo included; null for empty hands.


weaponFire: [number, number]

Defined in: client/api.d.ts:56

Dispatched each time the local player fires: the TESObjectWEAP form ID and the ammo it took, 0 for none.


weaponReload: [string]

Defined in: client/api.d.ts:71

Dispatched when the local player starts a reload. event is the animation event their game played.


weatherChange: [number, number]

Defined in: client/api.d.ts:156

Dispatched when the sky switches its current weather: a change the server made, this player’s own, or one the game rolled, starting its fade or snapping to it. previous is the weather it leaves, 0 for none. The fade itself goes on for up to a game hour; World.getSky follows it.


weatherRegionChange: [number, number]

Defined in: client/api.d.ts:166

Dispatched when the game finds the player under another weather region as they change cell: the TESRegion form ID whose weathers the sky would roll, 0 for none. The server hears it too (playerWeatherRegionChange).


workshopMode: [number, boolean]

Defined in: client/api.d.ts:146

Dispatched when the local player enters workshop mode at a workbench (entering) and when they leave it. workbench is the workbench reference’s form ID.


workshopMove: [number, object]

Defined in: client/api.d.ts:141

Dispatched when the local player puts a built object down somewhere else.


workshopPlace: [number, number, object]

Defined in: client/api.d.ts:136

Dispatched when the local player builds an object in workshop mode, as the server is asked for it: the base object, the workbench reference and where it stands.


workshopRemove: [number]

Defined in: client/api.d.ts:151

Dispatched when the local player scraps or stores a built object the session shares.


xpGain: [number]

Defined in: client/api.d.ts:76

Dispatched when the local player’s game awards XP, already scaled by the game.