跳到主要内容
版本:Next

Getting started

Client-side mods run inside the game alongside the OblivionMP client. They can read and change entity data, react to input, define custom data that is synchronized between players, and exchange custom network messages.

A mod is a .NET class library that references the OblivionMP SDK assemblies and defines a single class extending ModBase. The mod loader instantiates this class when the game starts.

A mod is one folder holding up to two halves, a client/ and a server/. The pages under Client-side mods cover the client half; server-side development covers the other one. Small mods only ever need the client half. See Mod management for the folder structure the server expects.

Start from the template

The quickest way to start is the official OblivionMP mod template. It ships a ready-to-build solution with client, server, and shared projects wired up against the SDK, plus a script that packages both mods. Clone it and follow the README.

Minimal mod class
using OblivionMp.Sdk;
using ReadyM.Api.DI;

public class MyMod : ModBase
{
public override string Name => "MyMod";

protected override void RegisterServices(IDependencyContainer services)
{
// register your services, components, RPC handlers, and archetype changes here
}

public override void Start()
{
// called once the game is ready; wire up key bindings and gameplay here
}
}

All SDK functionality is reached through the static SDK class, for example SDK.Input, SDK.Sync, SDK.Chat, SDK.GameMessage, SDK.Markers and SDK.Services.

信息

Everything registered in RegisterServices is resolved from the same dependency injection container the SDK uses. Any system or hosted service defined in your mod assembly is discovered and registered automatically.

Feature status

FeatureStatus
Key bindingsdone
Player & entity data🚧 mostly done
Custom data syncdone
Gameplay systemsdone
Custom RPCdone
Hosted servicesdone
Messages and markersdone
Mod config filesdone
Mod manifestsdone
Server-side modsdone
Save file API🚧 sync implemented, no public API yet