S9SourceNine Labs / CMAPI Docs 1.0
CMAPI / API reference

Mod

The base class for every CMAPI mod entry point.

View source ↗
CMAPI 1.0.0Standalone runtimeWindows x64Tested with Planet Crafter 2.008
Namespace CMAPIClassAssembly CMAPI.API.dll
public abstract class Mod

The base class for every CMAPI mod entry point.

Members

Helper

property
public IModHelper Helper

Gets the services assigned to this mod.

This property is available when Entry(IModHelper) is called.

Monitor

property
public IMonitor Monitor

Gets the logger attributed to this mod.

This property is available when Entry(IModHelper) is called.

Log

method
protected void Log(string message)

Writes a normal informational message for this mod.

LogWarning

method
protected void LogWarning(string message)

Writes a warning for this mod.

LogError

method
protected void LogError(string message)

Writes an error for this mod.

LogDebug

method
protected void LogDebug(string message)

Writes a development-only diagnostic message for this mod.

Entry

method
public abstract void Entry(IModHelper helper)

Initializes the mod and registers its events, commands, or other behavior.

CMAPI calls this method once during startup on the game's main thread. Throwing from this method prevents the mod from loading and causes CMAPI to remove events and commands registered earlier in the same call.