S&box Wiki

Revision Difference

.addon_schema#544152

<cat>Code.Misc</cat> <title>Addon Config Schema</title> An example addon config file from the [Minimal Game](https://github.com/Facepunch/sbox-minimal) showing the minimum configuration required to create an addon. ``` { "name": "minimal",⤶ "sharedassets": "*.*",⤶ ⤶ "depends": ⤶ [⤶ "base",⤶ "citizen",⤶ "rust"⤶ ],⤶ ⤶ "gamemodes":⤶ [⤶ {⤶ "name": "minimal",⤶ "title": "minimal"⤶ }⤶ ]⤶ "sharedassets": "*.*"⤶ } ``` ## Shared Assets Filter The `sharedassets` field is a search string required to send code and content from the server to clients. ``` "sharedassets": "*.*" ``` The search string will match against files in the addon's directory. It can contain a combination of valid literal path and wildcard (* and ?) characters, but doesn't support regular expressions. <warning>If this is an empty string or null - no code or content will be sent to clients.</warning> ⤶ ## Dependencies⤶ ⤶ Addons can depend on other addons content by simply specifying the addon name in the depends list.⤶ ⤶ ```⤶ "depends": ⤶ [⤶ "base",⤶ "citizen",⤶ "rust"⤶ ]⤶ ```⤶ ⤶ ## Gamemodes⤶ ⤶ Addons can contain multiple gamemode definitions, generally you will want to just define one.⤶ ⤶ ```⤶ "gamemodes":⤶ [⤶ {⤶ "name": "minimal",⤶ "title": "Minimal Game",⤶ "description": "It doesn't do anything.",⤶ "icon": "ui/mygame.png",⤶ }⤶ ]⤶ ```⤶ ⤶ * Name - should match the name Library marked on your <page text="Game">Sandbox.Game</page> class.⤶ * Title - a friendly name for your game that appears in the menu.⤶ * Description - should be a brief synopsis of your game.⤶ * Icon - used in the main menu.⤶ ## Unused properties The following properties exist but have no effect so there is no need to set them: * `"tags"` - multiple tags split by `;`⤶ * `"version"`⤶ * `"title"`⤶ * `"description"`⤶ * `"tags"` - multiple tags split by `;`⤶ * `"icon"` - icon not displayed anywhere.