LegacyShell WikiLegacyShell Wiki
Back to LegacyShell
Home
Wiki
Plugins
Docs
Back to LegacyShell
Home
Wiki
Plugins
Docs
  • Documentation

    • Getting Started

      • What is LegacyShell?
      • Speed Setup
      • Requirements
      • Installation
      • First Run
      • Config Files
      • Making an Account
      • Troubleshooting (Getting Started)
    • Running a Server

      • Architecture Overview
      • The Database
      • Users and Ranks
      • Adding Game Servers
      • Client Mirrors
      • Perpetual
      • Backups
      • Rate Limiting
      • Moderation
      • Closed Mode
      • Deployment
      • Troubleshooting (Running a Server)
      • Hosting for Someone Else's Instance
    • Content Creation

      • Maps
      • Dealing with Babylon Models
      • Map Blocks
      • Items and Skins
      • Hats and Stamps
      • Sounds
      • Gamemodes
      • Seasonal Events
    • Plugin Development

      • Quickstart
      • I Want To...
      • Anatomy of a Plugin
      • Lifecycle
      • Dependencies
      • Events (Concept)
      • Event Reference

        • services: events
        • game: events — shared logic (src/shell/)
        • game: events — main-thread server process
        • game: events — per-connection client object
        • game: events — room lifecycle & tick loop
        • game: events — in-browser gameplay
        • client: events — client server & build pipeline
      • Commands
      • Client-Side Code
      • Static Assets
      • Content Packs
      • Networking
      • Workers and State
      • Prediction and Authority
      • Recipes

        • Recipe: Killstreaks
        • Recipe: New Pickup Item
        • Recipe: New Gamemode
        • Recipe: Custom Weapon
        • Recipe: UI Modification
        • Recipe: Discord Integration
        • Recipe: Replacing Core Behaviour
        • Recipe: Persistent Plugin Storage
        • Recipe: Rewarding Players with Currency
        • Recipe: Custom Per-Player Data
        • Recipe: Custom Theme
      • Publishing
      • Pitfalls
      • Modifiers
      • Sound and Apollo
    • Codebase Reference

      • Repo Layout
      • Shared Shell Layer
      • Server-Only Markers
      • The ss Object
      • Build Pipeline
      • Stamps and Babylons
      • Game Loop
      • Rooms and Workers
      • Wire Protocol
      • Generated

        • Wire Protocol Opcodes
        • Enums & Lookup Tables
        • Database Schema
        • Config Reference
        • Slash Command Reference
      • Services Internals
      • Catalog and Items
      • Permissions Internals
      • Physics and Collision
      • Known Quirks
      • Codebase Anecdotes
      • Development Timeline
    • Contributing

      • Documentation Style Guide
      • Generators
      • For AI Agents

game: events — in-browser gameplay

Audience: Plugin authors and AI agents · Prereqs: Events (concept)

Every plugins.emit(...) and plugins.emitSync(...) call site found in the files below, extracted directly from source - not hand-maintained. Unprefixed at the call site; PluginManager.emit adds game: before checking for listeners, so e.g. the first row below actually fires as game:startUp.

EventLocationPayloadFires when
startUpserver-client/src/client-static/src/shellshock.min.js:118{ }The in-browser game client script finished its own top-level setup.
afterBullshitserver-client/src/client-static/src/shellshock.min.js:424{}Fires after an early setup block (the name is kept verbatim from the original game source).
LegacyShellOnMessageserver-client/src/client-static/src/shellshock.min.js:459{cmd, cmdName, input}Every incoming server packet, after opcode decoding, before dispatch — a general-purpose network message hook; data.input is a still-positioned Comm.In reader, so a plugin can read a custom opcode's payload here.
roomParamsUpdatedserver-client/src/client-static/src/shellshock.min.js:476{ roomParamsObj }A Comm.Code.updateRoomParams payload was just parsed (cheatsEnabled/Object.assign already handled by core) - lets a plugin render its own gameOptions.plugins-owned fields (e.g. legacyweather's weather/time rendering).
roundEndSFXserver-client/src/client-static/src/shellshock.min.js:524{roundLength, roundEndTime, betweenRounds}Round-end sound/UI cue.
playerDeathAnimationserver-client/src/client-static/src/shellshock.min.js:708{killedPlayer}A player's death animation is playing.
inGameSync1server-client/src/client-static/src/shellshock.min.js:842{ id, stateIdx, x, y, z, dx, dy, dz, climbing, pingLevelInt }First stage of processing an incoming per-player sync entry.
inGameSync2server-client/src/client-static/src/shellshock.min.js:945{ id, stateIdx, x, y, z, dx, dy, dz, climbing, pingLevelInt, dist, player }Second stage of processing an incoming per-player sync entry (remote players, distance-based detail).
inGameSync3server-client/src/client-static/src/shellshock.min.js:979{ id, stateIdx, x, y, z, dx, dy, dz, climbing, pingLevelInt, player }Third stage of processing an incoming per-player sync entry.
clearItemButtonsserver-client/src/client-static/src/shellshock.min.js:1428{ i, canvas }Shop/loadout UI item-button reset.
encloseRenderPageFuncserver-client/src/client-static/src/shellshock.min.js:1645{ i, b, canvas, renderingItem, locked, requiresPhysicalUnlock }Rendering one catalog item tile in the shop UI.
playerActorBodyMeshCreatedserver-client/src/client-static/src/shellshock.min.js:2023{ playerActor: this, bodyMesh: this.bodyMesh, player }A player's visual body mesh finished loading.
playerActorShadowRenderListserver-client/src/client-static/src/shellshock.min.js:2055{ playerActor: this, shadowGen: shadowGen }The player mesh was registered with the shadow generator.
playerActorRemoveFromPlayserver-client/src/client-static/src/shellshock.min.js:2332{ playerActor: this }A player's visual actor is being hidden (died or left).
playerActorRestoreToPlayserver-client/src/client-static/src/shellshock.min.js:2341{ playerActor: this }A player's visual actor is being restored (respawned).
grenadeActorFlashingserver-client/src/client-static/src/shellshock.min.js:2494{ grenadeActor: this }Every frame a live grenade's beep light is on (its emissive flash colour is set). fancygraphics hangs its grenade glow off this.
bulletActorFiredserver-client/src/client-static/src/shellshock.min.js:2545{ bulletActor: this }A visual bullet actor was fired client-side.
rocketActorFlyingserver-client/src/client-static/src/shellshock.min.js:2611{ rocketActor: this }Every frame a fired rocket's mesh is enabled and has just been moved to the rocket's position.
gunActorSetupserver-client/src/client-static/src/shellshock.min.js:2630{ gunActor: this, shadowGen }A weapon's visual model finished setup.
gunActorFiredserver-client/src/client-static/src/shellshock.min.js:2710{ gunActor: this }A gun actor fired client-side (any player), right after its fire sound plays and before the muzzle flash is shown.
onPageLoadedEndserver-client/src/client-static/src/shellshock.min.js:3573{}The game's HTML page finished loading.
playPressedserver-client/src/client-static/src/shellshock.min.js:3581``PLAY was pressed (on the main menu, or in the game menu): anything open over it, like a profile or the settings, should close.
joinGameserver-client/src/client-static/src/shellshock.min.js:3607{ joinGameIdPassed }The client is about to send its join request.
onExtraParamsserver-client/src/client-static/src/shellshock.min.js:3702{ extraParams }Extra join params (session, custom map, etc.) are being assembled.
clientOnExtraGameInfoserver-client/src/client-static/src/shellshock.min.js:3812{ extraInfo }Extra per-game info received from the server after joining.
onShadowGeneratorCreatedserver-client/src/client-static/src/shellshock.min.js:4083{ shadowGen }The Babylon shadow generator was created for the scene.
loadMaterialsserver-client/src/client-static/src/shellshock.min.js:4377{ scene }Core's built-in materials have just been defined - lets a plugin define its own right after (e.g. legacyweather's wet material).
loadSoundsserver-client/src/client-static/src/shellshock.min.js:4431{ soundsList }Before the Apollo/Howler sound list is loaded.
createMapCellsMapLoadedserver-client/src/client-static/src/shellshock.min.js:4562{ minMap, SPS, gameScene, shadowGen, shadowLight }The raw map JSON has been fetched and is about to be turned into cells.
modifyMinMapserver-client/src/client-static/src/shellshock.min.js:4612eventA direct hook to rewrite the map data itself before cell generation.
createMapCellsserver-client/src/client-static/src/shellshock.min.js:4639{ minMap, SPS, gameScene, shadowGen, shadowLight }Map cells are being generated from minMap.
lightmapReadyserver-client/src/client-static/src/shellshock.min.js:4887{ gameScene, lightMap, w, h, d }Synchronous notification after the static light field is calculated, before applying it to terrain. Payload includes scene, lightMap and grid dimensions w/h/d; reuse the field without new raycasts.
onMapCompleteBeforeSetupserver-client/src/client-static/src/shellshock.min.js:5045{ gameScene, minMap }Before final map setup finishes.
onMapCompleteserver-client/src/client-static/src/shellshock.min.js:5074{ gameScene }After final map setup finishes.
resetGamePlayerserver-client/src/client-static/src/shellshock.min.js:5348{player}Client-local counterpart to the server's resetGamePlayer — round-scoped UI/state reset.
leaveGameserver-client/src/client-static/src/shellshock.min.js:5470{}The player is leaving the game for the main menu - fired just before the game scene is disposed. A plugin should stop anything it started for the game (sounds, timers).
playerClickedserver-client/src/client-static/src/shellshock.min.js:5693clickA current player-list entry was clicked, before the default player menu opens. Receives { player, playerId, uniqueId, username, event, handled }. Set handled = true on this event object to replace the default menu; it is local to this click and supports async listeners. The player is checked again after listeners finish, so a departed player or reused slot cannot open the fallback menu. LegacyProfiles consumes this event to open its profile viewer.
addKillTextBeforeserver-client/src/client-static/src/shellshock.min.js:5792{msgs}Before the kill-feed text is rendered.
onBalanceUpdatedserver-client/src/client-static/src/shellshock.min.js:5814{balance: playerAccount.currentBalance}The player's currency balance display changed.
onResourcesLoadedEndserver-client/src/client-static/src/shellshock.min.js:5867{}All game resources (models/sounds/textures) finished loading.
shadowsToggledserver-client/src/client-static/src/shellshock.min.js:6665{ shadowsEnabled: false }Shadows were just switched on or off (by the settings or the auto-detail optimiser) and the map's material swapped with them; data.shadowsEnabled is the new state. Lets a plugin re-apply anything that replaces the map material.
shadowsToggledserver-client/src/client-static/src/shellshock.min.js:6672{ shadowsEnabled: true }Shadows were just switched on or off (by the settings or the auto-detail optimiser) and the map's material swapped with them; data.shadowsEnabled is the new state. Lets a plugin re-apply anything that replaces the map material.
explosionSpriteAfterserver-client/src/client-static/src/shellshock.min.js:7224{ sprite: s, manager, isFire: manager == explosionFireManager }After an explosion or rocket-trail smoke/fire sprite has been set up (spawned with its animColors, which are re-applied to sprite.color every tick, so a plugin recolours them by replacing sprite.animColors).
explosionFxserver-client/src/client-static/src/shellshock.min.js:7229{ x, y, z, damage, radius }An explosion's visual effects are about to be spawned client-side (grenade or rocket), with its position, damage and radius.
shellFragBurstBeforeserver-client/src/client-static/src/shellshock.min.js:7257{ player, count, theSize, theAnimLength }Before a shell-casing particle burst effect plays.
shellFragBurstAfterserver-client/src/client-static/src/shellshock.min.js:7286{ player, count }After an egg's shell fragments have been spawned (death or heavy damage); the fragment sprites are in shellFragManager.
yolkBurstAfterserver-client/src/client-static/src/shellshock.min.js:7314{ player, manager: yolkManager }After the yolk particles of an egg death have been spawned; manager is the yolk sprite manager.
syncToServerserver-client/src/client-static/src/shellshock.min.js:7995{loadout}The client is about to push a loadout change to the server.
waitForSetupAndAuthCompleteserver-client/src/client-static/src/shellshock.min.js:8280{waitIteration}The startup poll loop, waiting for auth and page setup to both finish, has started.
waitForSetupAndAuthCompleteCheckserver-client/src/client-static/src/shellshock.min.js:8293{waitIteration, customizer, authAttemptComplete, houseAdsLoaded}The startup poll loop is checking whether auth and page setup have both finished yet.
waitForSetupAndAuthCompleteReadyserver-client/src/client-static/src/shellshock.min.js:8296{waitIteration}The startup poll loop has confirmed both auth and page setup are ready.
setupCompleteserver-client/src/client-static/src/shellshock.min.js:8317{}The startup poll loop concluded successfully.
playPressedserver-client/src/client-static/src/shellshock.min.js:8632``PLAY was pressed (on the main menu, or in the game menu): anything open over it, like a profile or the settings, should close.
reachedEndserver-client/src/client-static/src/shellshock.min.js:9311{}End of the whole client script file, once.
loadMeshesBeforeMaterialserver-client/src/client-static/editor/js/mapEdit.js:88280{mesh}Same hook as the shared loading.js version, duplicated for the standalone map-editor page.
editorPointerDownserver-client/src/client-static/editor/js/mapEdit.js:88869{ event: evt, pick: pickResult }Before the normal editor pointer-down action. Synchronous and cancellable.
editorPointerUpserver-client/src/client-static/editor/js/mapEdit.js:88942{ event: evt, pick: pickResult }Before the normal editor pointer-up action. Synchronous and cancellable.
editorPointerMoveserver-client/src/client-static/editor/js/mapEdit.js:88959{ event: evt, pick: pickResult }Before the normal editor pointer-move action. Synchronous and cancellable.
editorMoveMapBeforeserver-client/src/client-static/editor/js/mapEdit.js:89842{}Before shifting map cells; synchronous notification.
editorMoveMapAfterserver-client/src/client-static/editor/js/mapEdit.js:89876{ dx, dy, dz }After shifting map cells. dx/dy/dz are the actual rounded world-space translation; synchronous notification.
editorInitMapBeforeserver-client/src/client-static/editor/js/mapEdit.js:89914{}Before clearing the current editor map; synchronous notification.
editorInitMapAfterserver-client/src/client-static/editor/js/mapEdit.js:89928{}After creating the empty editor map; synchronous notification.
editorLoadMapBeforeserver-client/src/client-static/editor/js/mapEdit.js:90067{ json }Before loading serialized editor data; synchronous notification with the JSON string.
editorLoadMapAfterserver-client/src/client-static/editor/js/mapEdit.js:90070{ json }After loading serialized editor data, including an empty input; synchronous notification with the JSON string.
editorLoadMapAfterserver-client/src/client-static/editor/js/mapEdit.js:90165{ json }After loading serialized editor data, including an empty input; synchronous notification with the JSON string.
editorExtentsBeforeserver-client/src/client-static/editor/js/mapEdit.js:90199{}Before calculating map bounds; synchronous notification.
editorExtentsAfterserver-client/src/client-static/editor/js/mapEdit.js:90240{ extents }After calculating map bounds; synchronously extend the extents object for plugin geometry.
editorSaveMapserver-client/src/client-static/editor/js/mapEdit.js:90288{ minMap, extents }Before returning the serialized minMap; synchronously append plugin metadata to minMap/extents.

This page was drafted with AI assistance and reviewed for accuracy. If something looks wrong, please open a PR or flag it.

Edit this page on GitHub
Last Updated:
Contributors: onlypuppy7
Prev
game: events — room lifecycle & tick loop
Next
client: events — client server & build pipeline