Skip to content

CommandFailure

Namespace Mc.Scripting.Commands · Kind class (sealed)

public sealed class CommandFailure : Exception

Thrown by an executor to fail the command with a message (red text, no stack trace in the log). The command result is 0.

Member Description
CommandFailure(string message) Creates a failure with a plain message.
CommandFailure(string translationKey, string message) Creates a failure with a translation key (client-translated) and an English fallback message.
public CommandFailure(string message)

Creates a failure with a plain message.

Parameters

Name Type Description
message string What went wrong, shown to the sender.
public CommandFailure(string translationKey, string message)

Creates a failure with a translation key (client-translated) and an English fallback message.

Parameters

Name Type Description
translationKey string The key, e.g. “commands.teleport.invalidPosition”.
message string The English text used by the console and as fallback.
Member Description
string? TranslationKey { get; } The translation key, if any.
public string? TranslationKey { get; }

The translation key, if any.