codeAPI Reference
s&box ServerSettings: Replicated server-controlled settings
ServerSettings API Reference
ServerSettings is a static class for server-controlled settings that are replicated to all clients.
Type Signature
CSHARP
public static class ServerSettingsExample Property
CSHARP
[Title( "Show Developer Entities" )]
[Group( "Other" )]
[ConVar( "sb.developer_entities", ConVarFlags.Replicated | ConVarFlags.GameSetting | ConVarFlags.Server, Help = "Show developer entities in the spawn menu." )]
public static bool DeveloperEntities { get; set; } = false;
public static bool ShowDeveloperEntities => Game.IsEditor || DeveloperEntities;Key Attributes
- [ConVar(name, flags)] - Defines a console variable. Use ConVarFlags.Replicated to sync to clients, ConVarFlags.Server for host-only, ConVarFlags.GameSetting for game configuration.
- [Title("name")] - Display name in the inspector.
- [Group("name")] - Groups related properties together.
- Help parameter - Description shown in console help.
Notes
- Properties with ConVarFlags.Replicated are automatically synchronized to all clients.
- ConVarFlags.Server ensures only the host can change the value.
- Use computed properties (like ShowDeveloperEntities) to combine conditions (e.g., editor override).
Was this helpful?