Getting Started for Plugin Developers
This guide helps you start building Oxygen plugins for SCUM servers. It covers the minimal setup, the plugin file layout, and where to go next.
What is Oxygen for Developers?
Oxygen provides a C# plugin runtime for SCUM servers. You write plugins in C#, drop them into the server plugin folder, and Oxygen compiles and loads them.
Key developer features:
- C#/.NET 8 runtime for plugins.
- Hot reload of
.csfiles. - Command and permission attributes.
- Hooks for player and server events.
- Managed timers for delayed and recurring logic.
- JSON config and data persistence helpers.
- HTTP server routes and HTTP client helpers.
- Read-only access to SCUM database data.
Prerequisites
Before writing your first plugin, ensure:
- Oxygen is installed and running on a SCUM server.
- You have file access to the server plugin directory.
- You have a code editor (VS Code, Rider, or Visual Studio).
If Oxygen is not installed, start with Installing Oxygen.
Directory Layout
These directories are used most often during development:
SCUM/
└── Binaries/
└── Win64/
└── oxygen/
├── plugins/ ← C# plugin files (.cs)
├── configs/ ← JSON config files
├── data/ ← JSON data files
└── logs/OxygenError.log ← Plugin compilation/runtime logsPlugin Skeleton
A minimal Oxygen plugin looks like this:
using System;
using Oxygen.Csharp.API;
using Oxygen.Csharp.Core;
[Info("My Plugin", "YourName", "1.0.0")]
[Description("Test plugin showing the new architecture")]
public class MyPlugin : OxygenPlugin
{
public override void OnLoad()
{
Console.WriteLine("My Plugin loaded");
}
[Command("hello")]
private void HelloCommand(PlayerBase player, string[] args)
{
player.Reply("Hello from Oxygen!");
}
}Save this as MyPlugin.cs in oxygen/plugins/. Oxygen will compile and load it.
Hot Reload
Oxygen automatically detects changes to .cs files and reloads plugins. This lets you iterate quickly without restarting the server.
If a plugin fails to load:
- Check
/logs/OxygenError.logfor compile errors. - Verify your file name and class name are valid.
- Confirm you are using the correct namespaces.
Core Concepts You Will Use
- Commands: Chat Commands
- Permissions: Permissions
- Player Hooks: Player Hooks
- Timers: Timers & Delays
- Config Files: Configuration
- Data Storage: Data Storage
- Web API: Web API for Plugins
- HTTP Client: HTTP client
- Database Access: Database Access
