API Reference

Complete reference documentation for all MDB Framework APIs.


Core APIs

Mod System

Patching System

IL2CPP Bridge

ImGui Integration


API Categories

By Difficulty

🟢 Beginner-Friendly

🟡 Intermediate

🔴 Advanced


Quick Reference

Mod Lifecycle

[Mod("Author.ModName", "Display Name", "1.0.0")]
public class MyMod : ModBase
{
    public override void OnLoad() { }           // Called once on load
    public override void OnUpdate() { }         // Every frame
    public override void OnFixedUpdate() { }    // Physics tick
    public override void OnLateUpdate() { }     // After all updates
    public override void OnGUI() { }            // ImGui rendering
}

Logging

Logger.Info("Info message");
Logger.Warning("Warning message");
Logger.Error("Error message");
Logger.Debug("Debug message");

Patching

[Patch("Namespace", "ClassName")]
[PatchMethod("MethodName", 2)]  // 2 parameters
public static class MyPatch
{
    [Prefix]
    public static bool Prefix(IntPtr __instance, int damage, float multiplier)
    {
        // Named parameters map positionally to native args
        // Return false to skip original
        return true;
    }
    
    [Postfix]
    public static void Postfix(ref int __result)
    {
        // Modify return value
    }
}

ImGui UI

public override void OnLoad()
{
    ImGuiManager.RegisterCallback(DrawUI, "My Window");
}

private void DrawUI()
{
    if (ImGui.Begin("My Window"))
    {
        ImGui.Text("Hello!");
        if (ImGui.Button("Click"))
            Logger.Info("Clicked!");
    }
    ImGui.End();
}

IL2CPP Bridge

// Find a class
IntPtr klass = Il2CppBridge.mdb_find_class("Assembly-CSharp", "Game", "Player");

// Get a method
IntPtr method = Il2CppBridge.mdb_get_method(klass, "TakeDamage", 1);

// Get a field value
IntPtr field = Il2CppBridge.mdb_get_field(klass, "health");
float health = Il2CppBridge.mdb_field_get_value<float>(instance, field);


← Back to Home Getting Started →