CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException Class Reference

A wrapper for the CommandSyntaxException so other developers don't have to import Mojang's brigadier. More...

+ Inheritance diagram for dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException:

Public Member Functions

 WrapperCommandSyntaxException (CommandSyntaxException exception)
 Creates a WrapperCommandSyntaxException. More...
 
CommandSyntaxException getException ()
 Returns the wrapped CommandSyntaxException. More...
 
String getMessage ()
 Returns the message together with the position it occurred on and some context. More...
 
synchronized Throwable getCause ()
 
StackTraceElement[] getStackTrace ()
 
synchronized Throwable initCause (Throwable cause)
 
String getLocalizedMessage ()
 
void printStackTrace ()
 
void printStackTrace (PrintStream s)
 
void printStackTrace (PrintWriter s)
 
void setStackTrace (StackTraceElement[] stackTrace)
 
Message getRawMessage ()
 Returns the raw message, not including positional information. More...
 
String getContext ()
 Returns some contextual information about where the error occurred. More...
 
CommandExceptionType getType ()
 Returns the type of the exception. More...
 
String getInput ()
 Returns the input that caused the CommandSyntaxException. More...
 
int getCursor ()
 Returns the cursor position. More...
 

Detailed Description

A wrapper for the CommandSyntaxException so other developers don't have to import Mojang's brigadier.

Constructor & Destructor Documentation

◆ WrapperCommandSyntaxException()

dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.WrapperCommandSyntaxException ( CommandSyntaxException  exception)

Creates a WrapperCommandSyntaxException.

Parameters
exceptionthe exception to wrap

Member Function Documentation

◆ getContext()

String dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.getContext ( )

Returns some contextual information about where the error occurred.

This is done by returning a few characters ({@value CommandSyntaxException::CONTEXT_AMOUNT}) of the faulty getInput() and a pointer to where the exception happened.

Returns
some contextual information about where the error occurred or null if getInput() or getCursor() are null/0.

◆ getCursor()

int dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.getCursor ( )

Returns the cursor position.

Returns
the cursor position or -1 if not set

◆ getException()

CommandSyntaxException dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.getException ( )

Returns the wrapped CommandSyntaxException.

Returns
the wrapped CommandSyntaxException

◆ getInput()

String dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.getInput ( )

Returns the input that caused the CommandSyntaxException.

Returns
the input that caused the CommandSyntaxException or null if not set

◆ getMessage()

String dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.getMessage ( )

Returns the message together with the position it occurred on and some context.

Returns
the message together with the position it occurred on and some context

◆ getRawMessage()

Message dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.getRawMessage ( )

Returns the raw message, not including positional information.

Returns
the raw message without any formatting or positional information

◆ getType()

CommandExceptionType dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException.getType ( )

Returns the type of the exception.

Returns
the type of the exception