πŸ‘€Writing Your First Plugin

Writing a plugin may seem difficult, but it is pretty straightforward!

First Lines of Code

CursedMod implements a Module Pattern to load plugins. Because of this plugins should have a main class that implements the CursedModule abstract class.

MyFirstModule.cs
public class MyFirstModule : CursedModule
{
    public override string ModuleName => "MyFirstModule";
    public override string ModuleAuthor => "Me";
    public override string ModuleVersion => "1.0.0.0";
    public override byte LoadPriority => (byte)ModulePriority.Medium;
    public override string CursedModVersion => CursedModInformation.Version;
}

Entry point

You can override CursedModule::OnLoaded() method to make your entry point:

public class MyFirstModule : CursedModule
{
    // public override string ModuleName .....
    
    public override void OnLoaded()
    {
        // All the code
        
        base.OnLoaded(); // Logs that the plugin has been loaded
    }
}

Exit Point

You can override CursedModule::OnUnloaded() method to make your exit point:

Last updated

Was this helpful?