auto_stories

s&box MCP Knowledgebase

Documentation, API references, code examples and community knowledge for s&box development.

library_books 595 entries menu_book 352 Documentation code 133 API Reference terminal 100 Code Example groups 10 Community
terminalCode Example
May 4, 2026

Sandbox: Ownable component — prop protection with IPhysgunEvent and IToolgunEvent

Ownable Component — Prop Protection and Physgun/Toolgun Access Control The component tracks which spawned a . It implements and to enforce ownership checks when…

terminalCode Example
May 4, 2026

Sandbox: UndoSystem — per-player undo stack with bounded history (128 steps)

UndoSystem — Per-Player Undo Stack The is a that maintains a per-player undo stack. Each entry holds a set of s that get destroyed when the undo is triggered. U…

terminalCode Example
May 4, 2026

Sandbox: Player spawn flow with PlayerData, events, and NetworkSpawn

Player Spawn Flow in s&box Sandbox The Sandbox game uses a (a ) to handle player connections and spawning. Here's the full pattern: GameManager spawns players o…

terminalCode Example
May 3, 2026

Noclip MoveMode with Collision Toggle

Noclip MoveMode Implementation Custom movement mode for noclip/fly behavior with collision toggle. Key Patterns MoveMode inheritance — override , , priority — 1…

terminalCode Example
May 3, 2026

NPC Ragdoll Creation with Clothing Preservation

NPC Ragdoll Creation with Clothing Pattern for creating ragdolls from NPCs including clothing preservation and bone merging. Key APIs **** — copies model, mater…

codeAPI Reference
May 3, 2026

BasePickup with ITriggerListener and ICollisionListener

BasePickup Abstract Class Abstract base for item pickups using trigger and collision detection with host-only consumption. Key Patterns **** — trigger volume pi…

codeAPI Reference
May 3, 2026

Door Component with IPressable Interface

Door Component with IPressable Map entity door with animated open/close using curves and the IPressable interface. Key Features AnimationCurve for smooth motion…

codeAPI Reference
May 3, 2026

LimitsSystem Per-Player Spawn Limits

LimitsSystem Per-Player Limits Enforces configurable spawn limits per player with automatic tracking via ISpawnEvents. Key Features Per-player tracking via Stea…

codeAPI Reference
May 3, 2026

GameManager.Spawn RPC with Ident Parsing

GameManager.Spawn RPC Broadcast RPC for spawning entities from string identifiers with automatic weapon pickup detection. Ident Format - Spawn a prop from asset…

codeAPI Reference
May 3, 2026

PlayerData Component for Stats and Respawn

PlayerData Component Persistent player data component tracking stats (kills, deaths), respawn state, and providing connection lookup. Key Properties Connection …

codeAPI Reference
May 3, 2026

Player Component with Static Accessors

Player Component Main player component that manages health, damage, camera, and interfaces with the inventory system. Static Accessors Key Properties HUD Visibi…

codeAPI Reference
May 3, 2026

BaseConstraintToolMode for Constraint Tools

BaseConstraintToolMode Abstract Class Base class for two-stage constraint tools (weld, rope, elastic, etc.) with selection point handling. Class Overview Contro…

codeAPI Reference
May 3, 2026

ToolMode SelectionPoint and Trace Helpers

ToolMode.SelectionPoint and Trace Helpers Helper methods and data structures for toolgun selection and placement. SelectionPoint Struct Trace Methods Placement …

codeAPI Reference
May 3, 2026

LinkedGameObjectBuilder for Finding Connected Objects

LinkedGameObjectBuilder Utility class for building a set of connected GameObjects by traversing physics joints, constraints, and manual links. Class Definition …

codeAPI Reference
May 3, 2026

Player Event Interfaces (Local and Global)

Local.IPlayerEvents and Global.IPlayerEvents Event interfaces for player lifecycle, damage, inventory, and camera events. Local fires to player hierarchy only; …

codeAPI Reference
May 3, 2026

ToolMode Base Class for Toolgun Modes

ToolMode Base Class Abstract base class for creating toolgun modes in s&box. Handles input registration, action dispatch, and HUD rendering. Class Overview Acti…

codeAPI Reference
May 3, 2026

Global.ISpawnEvents Spawn Event Interface

Global.ISpawnEvents Interface Scene-wide event interface for listening to spawn operations. Implement on components to receive pre/post spawn callbacks. Interfa…

terminalCode Example
May 3, 2026

GameManager INetworkListener Pattern

GameManager INetworkListener Pattern Game manager implementing connection lifecycle with player spawning and cleanup. Implemented Interfaces INetworkListener - …

terminalCode Example
May 3, 2026

PlayerInventory Weapon Switching

PlayerInventory Weapon Switching Weapon switching with host authority and IPlayerEvents delegation. Key Features Sync'd ActiveWeapon with Change callback for ne…

terminalCode Example
May 3, 2026

Physgun Grab State with Permission Checks

Physgun Grab State Pattern Implementation pattern for physgun object grabbing with ownership checks and IPhysgunEvent permissions. Key Features Sync'd GrabState…