Table of Contents

Class ConsoleItemAliases

Namespace
S1API.Console
Assembly
S1API.dll

Registers short, local aliases for item IDs accepted by the native give console command.

public static class ConsoleItemAliases
Inheritance
ConsoleItemAliases
Inherited Members

Remarks

Aliases are console conveniences only. Given items retain their canonical IDs, and aliases are not included in saves, recipes, multiplayer manifests, compatibility hashes, or network payloads.

Methods

Register(string, string)

Registers a short alias for an existing canonical item ID.

public static void Register(string alias, string canonicalItemId)

Parameters

alias string

The non-namespaced command token, such as mdma.

canonicalItemId string

The existing canonical item ID, such as example.mod:products/mdma.

Remarks

Call this after the canonical item has been registered. Native item IDs always take precedence over aliases. Repeating the same mapping is idempotent; attempting to reuse an alias for another item throws.

Exceptions

ArgumentNullException

Thrown when either argument is null.

ArgumentException

Thrown when an argument is empty, the alias is not a safe command token, or the canonical item is not registered.

InvalidOperationException

Thrown when the alias is already a native item ID or is registered for another canonical item.