MageAPI

v1.0.0·Updated 2025-09-12

An comprehensive framework for creating custom content in Mage Arena.

About this mod Author’s original text

MageAPI

MageAPI is a comprehensive BepInEx plugin that provides a powerful framework for creating custom content in Mage Arena. The API simplifies the process of adding new damageables, event subscriptions, and game mechanics while handling complex backend systems so modders can focus on design and implementation.

Features

  • Entity Health Management: Robust health system with event-driven damage handling
  • Collision Detection: Advanced collision system with filtering and event triggers
  • Instance Management: Centralized access to game singletons and object pools
  • Event System: Comprehensive event system for game lifecycle hooks
  • Modular Architecture: Clean, organized structure for easy extensibility

Installation

  • Prerequisites:
  • Mage Arena with BepInEx 5.4.21 or newer
  • Installation:

MageArena/

└── BepInEx/

└── plugins/

└── MageAPI

└── MageAPI.dll

Core Components

HealthModule

A comprehensive health management system that wraps MonoBehaviour entities with health functionality:

  • Custom health field integration
  • Death/respawn handling
  • Event-driven health changes
  • Collider management

DamageCollisionCheck

Advanced collision detection system:

  • Trigger and collision event handling
  • Health module integration
  • Collider filtering capabilities
  • Rigidbody support

InstanceManager

Centralized access to game instances:

  • Singleton managers (MainMenu, Bootstrap, Coloseum, etc.)
  • Object pools for all entity types
  • Player and NPC instance management

Event System

Comprehensive event architecture:

  • Client events
  • Player events
  • Game events
  • Miscellaneous events

Usage Examples

Creating a Custom Entity with Health

public class CustomEntity: MonoBehaviour

{

private HealthModule _healthModule;

private void Start()

{

_healthModule = gameObject.AddComponent();

_healthModule.Setup(this, 100f, OnDeath);

}

private void OnDeath()

{

// Custom death logic

}

}

Handling Collision Events

public class DamageDealer: MonoBehaviour

{

private DamageCollisionCheck _collisionCheck;

private void Start()

{

_collisionCheck = gameObject.AddComponent();

_collisionCheck.OnEnterHealthCollider += OnDamageableHit;

}

private void OnDamageableHit(Collider collider, HealthModule health)

{

health.Health -= 10f;

}

}

Using Game Events

public class GameEventHandler

{

public GameEventHandler()

{

Events.Player.PlayerDeathEvent.After += OnPlayerDeath;

Events.Game.GameStartEvent.After += OnGameStart;

}

private void OnPlayerDeath((PlayerInstance, object?) args)

{

// Handle player death

}

private void OnGameStart()

{

// Handle game start

}

}

API Structure

Namespaces

  • MageAPI.Enums: Game enumerations and types
  • MageAPI.Interfaces: Core interfaces
  • MageAPI.Modules: Modular systems and utilities
  • MageAPI.Modules.Events: Event system architecture
  • MageAPI.Mono: MonoBehaviour components and extensions
  • MageAPI.Managers: Management systems and singletons

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack

File & checksum

Filename
MageAPI-1.0.0.zip
File size
82.1 KiB