Class CommandSyntaxException
Namespace: Void.Minecraft.Commands.Brigadier.Exceptions
Assembly: Void.Minecraft.dll
Represents a command parsing or execution syntax failure with optional input context.
public class CommandSyntaxException : Exception, ISerializableInheritance
object ← Exception ← CommandSyntaxException
Implements
Inherited Members
Exception.GetBaseException(), Exception.GetType(), Exception.ToString(), Exception.Data, Exception.HelpLink, Exception.HResult, Exception.InnerException, Exception.Message, Exception.Source, Exception.StackTrace, Exception.TargetSite, Exception.SerializeObjectState, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
CommandSyntaxException(ICommandExceptionType, IMessage, string, int)
Represents a command parsing or execution syntax failure with optional input context.
public CommandSyntaxException(ICommandExceptionType type, IMessage message, string input = "", int cursor = -1)Parameters
The exception category.
message IMessage
The unformatted error message.
input string
The command input, or an empty string when unavailable.
cursor int
The failure position, or -1 when unavailable.
Fields
ContextAmount
Specifies the maximum number of input characters shown before the failure marker.
public const int ContextAmount = 10Field Value
Properties
BuiltInExceptions
Gets or sets the global provider used by Brigadier parsing code.
public static IBuiltInExceptionProvider BuiltInExceptions { get; set; }Property Value
Cursor
Gets the captured cursor position.
public int Cursor { get; }Property Value
Input
Gets the captured command input.
public string Input { get; }Property Value
Message
Gets the raw message augmented with cursor context when input is available.
public override string Message { get; }Property Value
RawMessage
Gets the unformatted message object.
public IMessage RawMessage { get; }Property Value
Type
Gets the exception category.
public ICommandExceptionType Type { get; }Property Value
Methods
GetContext()
Builds the input excerpt ending at the failure marker.
public string? GetContext()Returns
The excerpt, or null when the captured input is empty or whitespace.
GetMessage()
Builds the displayed error message.
public string GetMessage()Returns
The raw message, followed by a position and context excerpt when available.