COI Docs
Attributes

ConsoleCommand

Syntax

[ConsoleCommand()]

Attributes

typenamerequireddefault value
boolinvokeOnMainThreadnofalse
boolinvokeDuringSyncnofalse
stringdocumentationnonull
stringcustomCommandNamenonull

Example

[ConsoleCommand(true, false, null, "hello_world")]
GameCommandResult HelloWorld()
{
    return GameCommandResult.Success;
}

This will register a command that will run on the main thread and not during a sync. We also give it a custom name, which is what is called in the console.

Edit on GitHub

On this page