Slot-based inventory UI with BuildHash optimization
Slot-Based Inventory UI with BuildHash Optimization This example shows a slot-based inventory UI with BuildHash() optimization to prevent unnecessary rebuilds a…
Inventory Hotbar UI Component
Inventory HUD with Hotbar A Razor PanelComponent that displays player inventory slots as a hotbar with mouse wheel and number key support. Implementation Key Fe…
BuildHash pattern for Razor panel optimization
BuildHash Pattern for Razor Panel Optimization BuildHash is a method you can override in Razor panels to prevent unnecessary rebuilds when the underlying state …
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…
BaseWeapon and BaseCarryable Weapon Framework
BaseWeapon and BaseCarryable - Weapon Framework Base classes for creating weapons in s&box. Provides ammo management, view/world models, and input handling. Bas…
Sandbox: BaseCarryable — unified AimRay, WeaponModel resolution, and seat-aware damage
BaseCarryable — Unified Weapon Base with AimRay and Seat Support is the root class for all holdable items. It handles viewmodel/worldmodel management, a unified…
s&box BasePickup: Pickup item base
BasePickup Abstract Class API Reference BasePickup is an abstract Component for items that can be picked up by players. Implements ITriggerListener and ICollisi…
s&box DroppedWeapon: Weapon pickup
DroppedWeapon Component API Reference DroppedWeapon handles weapon pickup when a weapon is dropped in the world. Implements IPressable for interaction and Playe…
VirtualGrid
VirtualGrid Efficient virtualized grid component for large lists in UI. When to Use Use when displaying: Large item lists (100s-1000s) Inventories with many slo…
s&box JSONObject Save Data Helper for Components
This s&box-focused sample shows how to programmatically construct and deconstruct JSON for component save data. It is useful for player saves, world unlock stat…
s&box BasePickup: Trigger and collision-based pickup system
BasePickup API Reference BasePickup is an abstract Component for creating trigger or collision-based pickups (weapons, ammo, items). Type Signature Required Com…
PlayerInventory Weapon Switching
PlayerInventory Weapon Switching Weapon switching with host authority and IPlayerEvents delegation. Key Features Sync'd ActiveWeapon with Change callback for ne…
Sandbox: PlayerInventory — weapon slots, pickup, drop, and loadout persistence
Sandbox PlayerInventory — Weapon Slots, Pickup, Drop, and Loadout Persistence manages up to 6 weapon slots, handles pickup/drop logic, and delegates loadout sav…
ClothingContainer: Apply, ApplyAsync, CreateFromConnection, RemoveUnownedItems, and Body Group Masking
ClothingContainer: Avatar Dressing System — Apply, CreateFromConnection, and RemoveUnownedItems manages a player's avatar outfit. It handles clothing compatibil…
Randomized Clothing for NPC Citizens using Dresser.Randomize() on Prefabs
Overview This demonstrates how to create NPC citizen prefabs with randomized clothing using the built-in component. Each time the prefab spawns or is enabled, i…
Sync Properties: Networked State with Change Detection and Collections
The attribute on a Component property sends its latest value to other players each time it changes. Only the owner of the object can change synced properties. B…
Connection API: Properties, Methods, and Common Multiplayer Patterns
The class represents a network connection (client or server). Used extensively in multiplayer for identifying players, checking permissions, and managing networ…
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; …
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…
Project Structure Recommendations
Project Structure Recommendations Community guide for organizing s&box projects based on Facepunch examples and successful community projects. Recommended Folde…