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 — shared logic (src/shell/)

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

Every plugins.emit(...) 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:bulletHitEffect.

EventLocationPayloadFires when
bulletHitEffectsrc/shell/bullets.js:146{ x, y, z, dx, dy, dz, player: this.player }A bullet impact occurred (wall or player) — a visual/effect hook, fires on both client and server.
bulletHitAftersrc/shell/bullets.js:165{ x, y, z, dx, dy, dz, player: this.player }After hit resolution/damage has been applied for that bullet.
setUpShopAvailableBeforeEventLoopsrc/shell/catalog.js:255{ shop, Math, items, mondayStart, eventsMonday }Inside the weekly shop-rotation algorithm, before seasonal-event item pools are folded into the candidate set.
setUpShopAvailableBeforeApplysrc/shell/catalog.js:309{ shop, Math, items, mondayStart, eventsMonday }Inside the weekly shop-rotation algorithm, before the final tier selection is written to the database.
constantsFinishedsrc/shell/constants.js:538{}All shared constants/enums have been computed at module load — signals other shared modules that it's now safe to reference them.
eventsInitsrc/shell/events.js:256{ events: this.events, this: this }The seasonal EventManager finished loading defaultEvents. This same call site fires under either services: or game: depending on which process is running it.
GameTypesInitsrc/shell/gametypes.js:132{ GameTypes, ItemTypes, defaultOptions }Before GameTypes is deep-merged against defaultOptions — the extension point for registering an entirely new gamemode.
fireEggk47src/shell/guns.js:117{this: this, pos, dir, Eggk47}The Eggk47 fired — immediately followed by if (!plugins.cancel) Bullet.fire(...), so a listener can fully replace this weapon's projectile behavior by setting plugins.cancel.
fireDozenGaugesrc/shell/guns.js:147{this: this, pos, dir, DozenGauge}The Dozen Gauge fired — same plugins.cancel override pattern as fireEggk47.
fireDozenGaugeBulletsrc/shell/guns.js:154{this: this, pos, v1: this.v1, DozenGauge}One pellet of the Dozen Gauge's shotgun spread is about to fire — fires once per pellet, distinct from the single fireDozenGauge event for the overall trigger pull.
fireCSG1src/shell/guns.js:185{this: this, pos, dir, CSG1}The CSG1 (Free Ranger) fired — same plugins.cancel override pattern as fireEggk47.
fireCluck9mmsrc/shell/guns.js:215{this: this, pos, dir, Cluck9mm}The Cluck9mm fired — same plugins.cancel override pattern as fireEggk47.
fireRPEGGsrc/shell/guns.js:247{this: this, pos, dir, RPEGG}The RPEGG (Eggsploder) fired — followed by if (!plugins.cancel) Rocket.fire(...) rather than Bullet.fire(...), since this weapon fires a rocket projectile.
AllItemssrc/shell/items.js:100{ AllItems, ItemActor, dummyItem }Before the flat pickup-item array (AMMO, GRENADE, …) is indexed into ItemTypes — push a new pickup item type onto data.AllItems here. Fired from inside the exported initItems() function, called explicitly once plugins.loadPlugins('game') resolves (see server-game/run-game.js and server-game/src/worker.js) rather than automatically at module load — module-load-time firing was unreliable server-side. Still fires immediately at module load on the client, where no such ordering issue exists.
itemsLoadedsrc/shell/items.js:109{ AllItems, ItemTypes, ItemActor, dummyItem }After pickup items are indexed — ItemTypes and each item's id are now final. Same initItems() timing as AllItems above.
loadMeshesBeforeMaterialsrc/shell/loading.js:79{mesh}During mesh loading, before a material is assigned — lets a plugin swap in a different material/texture.
permissionsAfterSetupsrc/shell/permissions.js:707{ this: this }End of PermissionsConstructor's constructor, after every built-in command is registered — the extension point for registering new slash commands via data.this.newCommand(...).
updateBeforesrc/shell/player.js:241{ player: this, delta, resim }Start of Player.update(), before movement/physics for that tick — the main per-player-per-tick hook.
onStandOnBlocksrc/shell/player.js:746{mesh, this: this, out}Per-tick, when a player's feet resolve against a block mesh — used for special surface behavior (e.g. a parkour gamemode).
onStandOnTilesrc/shell/player.js:749{mesh, this: this}Per-tick, when a player's feet resolve against a tile mesh — same use case as onStandOnBlock for a different mesh category.
canJumpsrc/shell/player.js:758{ this: this, canJump }Before jump eligibility is finalized — a listener can override the boolean.
onPlayerDeathsrc/shell/player.js:1205{player: this, firedId}A player has died — firedId identifies the killer (or is absent/null for an environmental death).
prepareBabylonBeforesrc/shell/general/prepare-babylons.js:45{ baseBabylons, babylonDirFiles, addBabylonToZip }Model-build pipeline: register new .babylon filenames into data.baseBabylons before file paths are resolved.
prepareBabylonsrc/shell/general/prepare-babylons.js:84{ filename, baseBabylon: undefined, extraBabylons }Model-build pipeline: supply the actual file path for a previously-registered .babylon filename.
prepareBabylonExtrasrc/shell/general/prepare-babylons.js:141{ filename, baseBabylon, extraBabylonData, item }Model-build pipeline: reconcile a per-item "extra" babylon/skeleton against the base model (e.g. bone-index fixups).

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
Prev
services: events
Next
game: events — main-thread server process