

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.
Prerequisites:
Installation:
MageArena/
└── BepInEx/
└── plugins/
└── MageAPI
└── MageAPI.dll
A comprehensive health management system that wraps MonoBehaviour entities with health functionality:
Advanced collision detection system:
Centralized access to game instances:
Comprehensive event architecture:
public class CustomEntity : MonoBehaviour
{
private HealthModule _healthModule;
private void Start()
{
_healthModule = gameObject.AddComponent<HealthModule>();
_healthModule.Setup(this, 100f, OnDeath);
}
private void OnDeath()
{
// Custom death logic
}
}
public class DamageDealer : MonoBehaviour
{
private DamageCollisionCheck _collisionCheck;
private void Start()
{
_collisionCheck = gameObject.AddComponent<DamageCollisionCheck>();
_collisionCheck.OnEnterHealthCollider += OnDamageableHit;
}
private void OnDamageableHit(Collider collider, HealthModule health)
{
health.Health -= 10f;
}
}
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
}
}
MageAPI.Enums: Game enumerations and typesMageAPI.Interfaces: Core interfacesMageAPI.Modules: Modular systems and utilitiesMageAPI.Modules.Events: Event system architectureMageAPI.Mono: MonoBehaviour components and extensionsMageAPI.Managers: Management systems and singletons