playerConnect(player: Player)- Dispatched once a connecting player's entity exists. It has no position yet; wait for `playerReady` to place them.
playerReady(player: Player)- Dispatched once the player's world is synced and they stand in it: the moment to spawn, dress and equip them. Their inventory record follows shortly after, with their first report.
playerDisconnect(player: Player)- Dispatched while a player is leaving, before their entity is destroyed, so the handle still reads. Anything keyed on the player is cleaned up here.
playerDeath(player: Player, killer: Player | null)- Dispatched once when a player dies. `killer` is the last player who hit them, or null. Nothing brings them back on its own: call `player.respawn`.
playerShoot(player: Player)- Dispatched when a player fires, before the shot is shown to the players around them.
playerProjectile(player: Player, projectile: number, npc: Npc | null)- Dispatched when a player's game launches a projectile: a missile, a grenade in flight, a flame, or one an NPC it simulates launched (`npc`). `projectile` is the BGSProjectile form ID. Return `false` to refuse: nobody else sees it. It still flies on the shooter's own screen.
playerSpaceChange(player: Player, space: PlayerSpace, previous: PlayerSpace | null)- Dispatched when a player's game reports them in another worldspace or interior: through a door, a fast travel or `teleport`. `previous` is null for the first space they report after joining.
playerAppearanceChange(player: Player)- Dispatched when a player's game reports a new look after the one they joined with: the look editor closed, or `setLook`, `randomizeLook` or `setAppearance` changed it. `getAppearance` reads it.
playerHit(attacker: Player, victim: Player, damage: number, kind: "direct" | "blast" | "hazard" | "vats", vatsChance: number, limb: string | null, weapon: number | null)- Dispatched when a player's game lands a hit on another player, before the victim takes it. Return `false` to drop the hit. `damage` is the attacker's game's own. `kind` is a shot or a blow, an explosion's blast, a hazard the attacker left (a radiation or gas cloud), which casts its spell and carries no damage figure, or a shot of a VATS attack, whose hit the attacker's game rolled against the chance it showed: refusing one decides VATS hits on the server (their chances are the game's fVATS* settings, `setGameSetting`). `vatsChance` is the chance the attacker's VATS showed for the shot, 0 to 1, and 0 for any other kind; with `setVatsRolledByServer` every such shot strikes on the attacker's screen, and the handler rolls it, as `Math.random() < vatsChance`. `limb` is the body part struck, as the game names its types ("Head1", "LeftArm1", "Torso"...), null for a blast or none; `weapon` is the weapon form the hit came from, null for none.
playerActivatePlayer(player: Player, target: Player)- Dispatched when a player activates another player's body, the Activate button on them: where a trade, a search, a handover or any player-to-player interaction starts. The two stand within reach in the same space.
playerReload(player: Player, event: string)- Dispatched when a player starts a reload, before it is shown to the players around them. `event` is the animation event their game played.
playerAttack(player: Player, event: string)- Dispatched when a player swings a melee weapon or their fists, before it is shown to the players around them. `event` is the animation event their game took, `meleeattackStart` among others.
playerExplosion(player: Player, position: Vector3, explosion: number, npc: number | null)- Dispatched when a player's game sets off an explosion: a grenade, a mine, a missile, an explosive round, or one an NPC it simulates set off (`npc`, its network ID). `explosion` is the BGSExplosion form ID. Return `false` to refuse it: nobody else sees it and its blast lands on no one.
playerPowerArmor(player: Player, entered: boolean)- Dispatched once when a player gets into a power armor frame (`entered`) and once when they get out, however it happened.
playerSwim(player: Player, swimming: boolean)- Dispatched once when a player starts swimming and once when they are back on their feet, as their game reports it.
playerUnderwater(player: Player, underwater: boolean)- Dispatched once when the water reaches above a player's neck (`player.isUnderwater`) and once when it no longer does, as their game reports it.
playerJetpack(player: Player, firing: boolean)- Dispatched once when the jetpack of a player's power armor starts thrusting and once when it stops, as their game reports it.
playerPowerArmorBattery(player: Player, charge: number, previous: number)- Dispatched when the charge of the fusion core in a player's power armor changes, in whole units: their game drains it (a jump, among others), a new core is loaded, or `setPowerArmorBattery` set it. Not on getting in.
playerFusionCore(player: Player, kind: "consumed" | "inserted" | "ejected", core: number | null, condition: number)- Dispatched when a player's game takes a fusion core into their power armor or launches it out. `consumed`: the suit's core ran out and their game loaded the next one they carry. `inserted`: a core went into the empty suit as it reached them. `ejected`: they launched the core out of the suit (Nuclear Physicist), `core` null. `condition` is the core's charge in percent. Return `false` to refuse a core taken in: it goes back to their inventory, the suit keeps the charge it had and takes no other core until `setPowerArmorBattery` gives it a charge or they get out. A launch cannot be refused.
playerChat(player: Player, text: string)- Dispatched for a chat line, before anyone sees it. Return `false` to swallow it.
playerCommand(player: Player, command: string, args: string[])- Dispatched for a `/command arg...` line; `command` has no slash.
worldHourChange(hour: number)- Dispatched when the running clock reaches a new whole hour, 0 to 23. `World.setHour` does not raise it.
worldLightning(weather: number)- Dispatched when the server strikes lightning on its own, for a thundery weather a sky is held to: the World's, or one a player was given. `World.strikeLightning` does not raise it.
playerWeatherRegionChange(player: Player, region: number, previous: number)- Dispatched when a player's game finds them under another weather region, as they change cell: `region` is the TESRegion form ID, 0 for none. Its weathers come from `World.getRegionWeathers`.
worldDayChange(date: WorldDate, daysPassed: number)- Dispatched when the running clock passes midnight into a new day, with the new date and day count. `World.setDate` and `World.setDaysPassed` do not raise it.
doorChange(player: Player, ref: number, open: boolean)- Dispatched when a player opens or closes a door. Return `false` to refuse: their door swings back.
lockChange(player: Player, ref: number, locked: boolean)- Dispatched when a player picks, unlocks or locks a lock. Return `false` to refuse: their lock goes back.
containerOpen(player: Player, ref: number)- Dispatched when a player opens a container nobody else holds. Return `false` to keep it shut.
containerClose(player: Player, ref: number)- Dispatched when the player holding a container closes its menu; anyone may open it again.
containerChange(player: Player, ref: number, items: InventoryItem[])- Dispatched when a player's game reports what a container holds now, after they put something in or took something out. To refuse a transfer, refuse the player's `inventoryChange`, which reverts the container with it.
itemDrop(player: Player, item: Item)- Dispatched when a player drops an item. Return `false` to refuse: the item leaves the world and goes back into their inventory.
itemPickUp(player: Player, item: Item | null, ref: number | null)- Dispatched when a player picks up a loose item, before they get it: a dropped or spawned `item`, or a placed reference by its form ID as `ref`. Return `false` to refuse; the item stays where it is.
inventoryChange(player: Player, changes: InventoryDelta[])- Dispatched when a player's game reports a change the server would accept: looting, buying, crafting, using an item. Return `false` to refuse it: the server keeps its record and sends it back to their game, and any container involved keeps what it held. Changes a script made itself do not raise it.
playerCharacterLoad(player: Player)- Dispatched once a player's character is established, shortly after they join: adopted from their game. Restore a kept character here with `setCharacter`. Character methods work from here.
playerXpGain(player: Player, amount: number)- Dispatched when the player's game awards XP: a kill, a quest, a lock, a terminal, a workshop build. `amount` is the game's, Intelligence included. Return `false` to refuse it: their game takes it back.
playerLevelChange(player: Player, level: number, previous: number)- Dispatched when the character's level moves, by XP or by a script.
playerPerkRequest(player: Player, perk: number, kind: "buy" | "grant" | "remove")- Dispatched when the player's game changes a perk rank: bought on the perk chart (after the server checked points, level, the rank below and SPECIAL), given by something in the game such as a magazine, or taken away. Return `false` to refuse it: their game undoes it.
playerPerkChange(player: Player, perk: number, added: boolean)- Dispatched when a perk rank was added to or taken from the character, by their game or by a script.
playerValueRequest(player: Player, value: string, previous: number, base: number)- Dispatched when the player's game moves a SPECIAL base: the SPECIAL menu, a bobblehead, a book. `value` is its editor ID. Return `false` to refuse it: their game puts it back.
playerValueChange(player: Player, value: string, base: number, previous: number)- Dispatched when an actor value base on the character's record moved, by their game or by a script.
playerBountyChange(player: Player, faction: number, bounty: number, previous: number)- Dispatched when the bounty a player owes a crime faction changes in their game: a crime of theirs the faction saw, a payment, or `setBounty` / `addBounty`. `bounty` is the crime gold now, violent and not together. Where wanted levels and police chases start.
zoneEnter(player: Player, zone: number, name: string)- Dispatched when a player comes into a zone `Zone.create` made, or is in it when it is made.
zoneLeave(player: Player, zone: number, name: string)- Dispatched when a player goes out of a zone, or the zone is removed around them. A player who leaves the server is not told.
playerFastTravel(player: Player, destination: number)- Dispatched when a player's game is about to fast travel: a marker picked on the Pip-Boy map, or the game's own scripts. `destination` is the reference they would arrive at, a map marker's form ID. Their game waits for the answer. Return `false` to refuse it: they stay where they are. Otherwise they travel.
playerLocationChange(player: Player, location: number | null, previous: number | null)- Dispatched when a player's game moves them into another named location (a BGSLocation form ID), or out into the open (null). `previous` is null for the first one they report after joining.
playerMapWaypoint(player: Player, position: Vector3 | null)- Dispatched when a player drops their own marker on the Pip-Boy map, or removes it (`position` null). Return `false` to refuse it: their game puts back what they had.
playerLockpickStart(player: Player, ref: number)- Dispatched when a player's game is about to open the lockpicking minigame on a locked door or container (`ref`, the placed reference's form ID). Their game waits for the answer. Return `false` to refuse it: the lock stays shut and no pick is spent. Otherwise their game opens it, still checking their bobby pins and whether the lock can be picked at all. `playerLockPick` and `lockChange` follow a pick.
playerTerminalOpen(player: Player, ref: number)- Dispatched when a player sits at a terminal (`ref`, the placed reference's form ID) and their game is about to open it. Their game waits for the answer, the player seated. Return `false` to refuse it: they get up without it opening. Otherwise it opens, its hacking minigame first while it is locked. The client's `References.getTerminal` reads what it holds.
playerSleepWait(player: Player, ref: number, sleep: boolean)- Dispatched when a player's game is about to open the sleep and wait menu: `sleep` true for a bed they activated, false for waiting in a seat they sit in (`ref`, the placed reference's form ID; 0 for one placed at runtime). Their game waits for the answer. Return `false` to refuse it: no menu opens and no hours pass. Otherwise it opens as the game would, still refused by the game itself with enemies near, in the air, taking damage and so on. The hours a player then sleeps or waits pass on their own game only and their health heals; the server's clock is the World's, and their game's clock goes back to it once the menu closes.
playerTerminalHack(player: Player, terminal: number | null)- Dispatched when a player hacks a terminal: the password was found. `terminal` is the terminal reference's form ID. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerLockPick(player: Player)- Dispatched when a player picks a lock in the lockpicking minigame. `lockChange` follows with the reference. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerCraft(player: Player, workbench: number | null, recipe: number | null, item: number | null, count: number)- Dispatched when a player makes something at a workbench: cooking, chemistry, or a weapon or armor mod. `workbench` is the bench's base furniture, `recipe` the constructible object used, `item` what it makes and `count` how many, as the recipe says. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerContainerLoot(player: Player, container: number | null)- Dispatched when a player takes something from a container. `container` is the container reference's form ID. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerBookRead(player: Player, book: number | null)- Dispatched when a player reads a book or magazine, the TESObjectBOOK form ID. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerPickpocket(player: Player, victim: number | null, success: boolean)- Dispatched when a player takes an item by pickpocketing. `victim` is the actor robbed. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerMineDisarm(player: Player)- Dispatched when a player disarms a mine. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerSpeechChallenge(player: Player)- Dispatched when a player passes a speech challenge in a dialogue. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerSteal(player: Player, count: number)- Dispatched when a player's game counts a theft: items taken that belong to someone else. `count` is how many. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerAddicted(player: Player, item: number | null)- Dispatched when a player becomes addicted. `item` is the chem or drink that did it. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerTrespass(player: Player)- Dispatched when a player is caught trespassing by the game's own crime system. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerAssault(player: Player)- Dispatched when the game's crime system records an assault by a player on one of its NPCs. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerMurder(player: Player)- Dispatched when the game's crime system records a murder by a player. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerLocationCleared(player: Player)- Dispatched when the game marks the location a player is in as cleared; `Player.getLocation` names it. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerCriticalHit(player: Player, weapon: number | null, critical: boolean)- Dispatched when a player lands a sneak attack (`critical` false) or a critical hit (true) on an actor, as their HUD says it. `weapon` is the weapon's form ID, null for bare hands. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerLocationDiscover(player: Player, marker: number | null)- Dispatched when a player discovers a location by coming up to it. `marker` is the map marker reference, the one `Player.discoverLocations` takes; what a script reveals that way is not reported. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerFusionCoreConsume(player: Player)- Dispatched when a fusion core runs out in a player's game: their power armor's, or the last shot of one they fired. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerFusionCoreEject(player: Player)- Dispatched when a fusion core is ejected from power armor in a player's game. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerJunkFound(player: Player, count: number)- Dispatched when junk enters a player's inventory, picked up or given, with the count their game adds to its junk collected stat. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerHolotape(player: Player, holotape: number | null, playing: boolean)- Dispatched when a player's holotape starts, pauses, resumes or stops: `holotape` is the tape's form ID and `playing` whether it runs now. A tape that plays a recording; one that opens a terminal or a game is not reported. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerSandmanKill(player: Player)- Dispatched when a player kills a sleeping actor with the Mister Sandman kill. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerCorpseEat(player: Player)- Dispatched when a player feeds on a corpse, as the Cannibal perk lets them. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerInvest(player: Player)- Dispatched when a player invests caps in one of the game's vendors. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerRicochet(player: Player)- Dispatched when a shot at a player bounces back and kills the shooter, the Ricochet perk's doing. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerMysteriousStranger(player: Player)- Dispatched when the Mysterious Stranger turns up for a player in VATS. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerDisarm(player: Player, target: number | null)- Dispatched when a player knocks the weapon out of an actor's hands. `target` is the actor disarmed. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
playerBobblehead(player: Player)- Dispatched when a player collects a bobblehead. Reported by the player's game after the fact: it cannot be refused, and the form IDs are the client's word.
mineLaid(mine: Mine)- Dispatched once a player's mine settles and is armed. Return `false` to refuse: it leaves the world unexploded.
mineTrigger(mine: Mine, player: Player)- Dispatched when a player walks onto another player's mine, before it goes off. Return `false` to keep it armed; the player's game asks again every half second while they stand on it.
mineRemove(mine: Mine)- Dispatched when a mine goes, whatever took it: its blast, a disarm, its owner leaving or a script. The handle still reads.
npcHit(attacker: Player, npc: Npc, damage: number, kind: "direct" | "blast" | "vats", vatsChance: number, limb: string | null, weapon: number | null)- Dispatched when a player's game lands a hit on an NPC, before the NPC takes it. Return `false` to drop the hit, except on an NPC the attacker's own game runs (`getSimulator`), which took it already: that one is told so scripts learn who hit it, and the attacker is still the killer `npcDeath` names. `damage` is the attacker's game's own; `kind` is a shot or a blow, an explosion's blast, or a shot of a VATS attack, whose hit the attacker's game rolled against the chance it showed: refusing one decides VATS hits on the server. `vatsChance` is the chance the attacker's VATS showed, 0 to 1, and 0 for any other kind, as for `playerHit`. `limb` is the body part struck, as the game names its types ("Head1", "LeftArm1", "Torso"...), null for a blast or none; `weapon` is the weapon form the hit came from, null for none.
npcAttack(npc: Npc, victim: Player, damage: number, kind: "direct" | "blast", limb: string | null, weapon: number | null)- Dispatched when an NPC lands a hit on a player, before the victim takes it. Return `false` to drop the hit, except on a player whose own game runs the NPC (`getSimulator`), who took it already: that one is told so scripts learn of it. `damage` is the game's own, from the client that runs the NPC. `limb` is the body part struck, as the game names its types ("Head1", "LeftArm1", "Torso"...), null for a blast or none; `weapon` is the weapon form the hit came from, null for none.
npcDeath(npc: Npc, killer: Player | null)- Dispatched once when an NPC dies. `killer` is the last player who hit it, or null. It comes back on its own a while later; `npcRespawn` follows.
npcActivate(player: Player, npc: Npc)- Dispatched when a player activates an NPC, the Activate button on its body: what a shopkeeper, a quest giver or any interaction starts from. Raised whether or not `setActivationBlocked` stops the game's own greeting and dialogue.
npcTarget(npc: Npc, target: Player | Npc | null)- Dispatched when the player or NPC an NPC fights changes, as the game that runs it decides: it noticed an enemy, switched to another, or stopped fighting (`target` null, also on its death). Where aggro, bounties and wanted levels start.
npcArrive(npc: Npc)- Dispatched once when an NPC reaches where `goTo` sent it; it then stands there until `stopGoing` or the next `goTo`. Sent after a body, it is raised again each time it catches up after the body walked off.
npcRespawn(npc: Npc)- Dispatched when an NPC is back at its placement, whole: on its own after its death, or from `respawn`.
npcSimulatorChange(npc: Npc, simulator: Player | null)- Dispatched when another player's game takes over running an NPC, or when nobody near does any more (`simulator` null) and the server walks it.
npcLeaderChange(npc: Npc, leader: Player | null)- Dispatched when an NPC becomes a player's companion (`setLeader`), or follows nobody any more (`leader` null): let go, or its leader left.
workshopBuild(player: Player, form: number, workbench: number, position: Vector3, angle: Vector3)- Dispatched when a player builds an object in a settlement, before anyone else sees it. Return `false` to refuse: their game takes it back out. The recipe's components are theirs to have spent; the server cannot refund them.
workshopMove(player: Player, item: WorkshopItem, position: Vector3, angle: Vector3)- Dispatched when a player moves a built object, before anyone else sees it. Return `false` to refuse: the object is put back where it was for everyone, as a new `WorkshopItem`, and the old handle reads nothing.
workshopEnter(player: Player, workbench: number)- Dispatched when a player enters workshop mode at a workbench, the workbench reference's form ID.
workshopLeave(player: Player, workbench: number)- Dispatched when a player leaves workshop mode, or enters it at another workbench.
workshopScrap(player: Player, item: WorkshopItem)- Dispatched when a player scraps or stores a built object, before it goes for everyone. Return `false` to refuse: the object is put back for everyone, as a new `WorkshopItem`, and the old handle reads nothing. The player keeps what their game gave them for it.
resourceStart(resourceName: string)- Dispatched after a resource entry point has run and immediately before the resource becomes running.
resourceStop(resourceName: string)- Dispatched while a resource is stopping, before its stop callback, timers, exports and event handlers are cleaned up.
entityStateChange(entity: Entity, key: string, value: any, previous: any)- 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.
consoleCommand(command: string, args: string[])- Dispatched for a line typed into the server console that no built-in command (help, ensure, refresh, ...) claimed. `args` is the rest of the line, split on whitespace. The console is the operator's, so this is the place for commands no player may run.
playerVoiceStart(player: Player)- Dispatched when a player starts speaking, as isPlayerTalking turns true.
playerVoiceStop(player: Player)- Dispatched shortly after a player's last voice frame, as isPlayerTalking turns false. A player who disconnects while talking gets no stop, so clear them on disconnect too.
playerVoiceTierChange(player: Player, tier: number)- Dispatched when a player switches voice tier themselves: 0 whisper, 1 normal, 2 shout. setPlayerTier does not raise it.
playerConnecting(connection: PendingConnection)- Dispatched when a player asks to join, before the connection exists: they hold no player slot, are not counted as online, and are sent nothing -- no resource list, no download, no body. The request waits until every handler has returned and every Promise a handler returned has settled, then it is let in if a player slot is free (otherwise it is refused as full). `connection.reject()` turns it away instead, and so does a handler that throws or rejects, or handlers that have not settled within the server's admission timeout (30 seconds by default, restarted by every `connection.update()`). With no handler at all, every request is let in at once.