S9SourceNine Labs / CMAPI Docs 1.0
CMAPI / Migrations

Migrate from 0.7

Update a CMAPI 0.7 mod for the 0.8 API.

View source ↗
CMAPI 1.0.0Standalone runtimeWindows x64Tested with Planet Crafter 2.008

Migrate a CMAPI 0.7.x mod to 0.8.0

CMAPI 0.8.0 keeps the 0.7.x player, event, item, Terra Token, notification, and existing console-command contracts. A 0.7.x mod does not need code changes just because the catalog exists, so keep its old MinimumApiVersion unless it uses the new metadata API.

Raise the manifest requirement when using ConsoleCommandOptions:

JSON
"MinimumApiVersion": "0.8.0"

The existing overload still works and places a command in Mods:

CSHARP
helper.ConsoleCommands.Add(
    "weather_report",
    "Shows the current weather.",
    "weather_report",
    OnWeatherReport
);

To add a category and aliases:

CSHARP
helper.ConsoleCommands.Add(
    "weather_report",
    "Shows the current weather.",
    new ConsoleCommandOptions(
        "weather_report [planet]",
        "Weather",
        "weather"
    ),
    OnWeatherReport
);

Aliases are not separate commands. They invoke the canonical handler, appear in help <command>, participate in collision checks, and are removed with their owner. IConsoleCommandContext.CommandName contains the canonical registered name even when the player entered an alias.

For console-facing instructions, replace doctor with health_check. The old name was removed before public release instead of being retained as a permanent alias. Use commands [search] for discovery and keep help <command> for full details.