CommandFailure
Namespace Mc.Scripting.Commands · Kind class (sealed)
public sealed class CommandFailure : ExceptionThrown by an executor to fail the command with a message (red text, no stack trace in the log). The command result is 0.
Constructors
Section titled “Constructors”| 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. |
Constructor
Section titled “Constructor”public CommandFailure(string message)Creates a failure with a plain message.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string |
What went wrong, shown to the sender. |
Constructor
Section titled “Constructor”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. |
Properties
Section titled “Properties”| Member | Description |
|---|---|
string? TranslationKey { get; } |
The translation key, if any. |
TranslationKey
Section titled “TranslationKey”public string? TranslationKey { get; }The translation key, if any.