CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException Class Reference

An exception used to create command-related errors for the CustomArgument. More...

+ Inheritance diagram for dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException:

Public Member Functions

 CustomArgumentException (BaseComponent[] errorMessage)
 Constructs a CustomArgumentException with a given error message. More...
 
 CustomArgumentException (String errorMessage)
 Constructs a CustomArgumentException with a given error message. More...
 
 CustomArgumentException (MessageBuilder errorMessage)
 Constructs a CustomArgumentException with a given error message. More...
 
CommandSyntaxException toCommandSyntax (String result, CommandContext<?> cmdCtx)
 Converts this CustomArgumentException into a CommandSyntaxException. More...
 

Static Public Member Functions

static CustomArgumentException fromBaseComponents (BaseComponent[] errorMessage)
 Constructs a CustomArgumentException with a given error message. More...
 
static CustomArgumentException fromString (String errorMessage)
 Constructs a CustomArgumentException with a given error message. More...
 
static CustomArgumentException fromAdventureComponent (Component errorMessage)
 Constructs a CustomArgumentException with a given error message. More...
 
static CustomArgumentException fromMessageBuilder (MessageBuilder errorMessage)
 Constructs a CustomArgumentException with a given error message. More...
 

Detailed Description

An exception used to create command-related errors for the CustomArgument.

Constructor & Destructor Documentation

◆ CustomArgumentException() [1/3]

dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.CustomArgumentException ( BaseComponent[]  errorMessage)

Constructs a CustomArgumentException with a given error message.

Parameters
errorMessagethe error message to display to the user when this exception is thrown
Deprecated:
Use CustomArgumentException#fromBaseComponents(BaseComponent...) instead

◆ CustomArgumentException() [2/3]

dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.CustomArgumentException ( String  errorMessage)

Constructs a CustomArgumentException with a given error message.

Parameters
errorMessagethe error message to display to the user when this exception is thrown
Deprecated:
Use CustomArgumentException#fromString(String) instead

◆ CustomArgumentException() [3/3]

dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.CustomArgumentException ( MessageBuilder  errorMessage)

Constructs a CustomArgumentException with a given error message.

Parameters
errorMessagethe error message to display to the user when this exception is thrown
Deprecated:
Use CustomArgumentException#fromMessageBuilder(MessageBuilder) instead

Member Function Documentation

◆ fromAdventureComponent()

static CustomArgumentException dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.fromAdventureComponent ( Component  errorMessage)
static

Constructs a CustomArgumentException with a given error message.

Parameters
errorMessagethe error message to display to the user when this exception is thrown

◆ fromBaseComponents()

static CustomArgumentException dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.fromBaseComponents ( BaseComponent[]  errorMessage)
static

Constructs a CustomArgumentException with a given error message.

Parameters
errorMessagethe error message to display to the user when this exception is thrown

◆ fromMessageBuilder()

static CustomArgumentException dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.fromMessageBuilder ( MessageBuilder  errorMessage)
static

Constructs a CustomArgumentException with a given error message.

Parameters
errorMessagethe error message to display to the user when this exception is thrown

◆ fromString()

static CustomArgumentException dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.fromString ( String  errorMessage)
static

Constructs a CustomArgumentException with a given error message.

Parameters
errorMessagethe error message to display to the user when this exception is thrown

◆ toCommandSyntax()

CommandSyntaxException dev.jorel.commandapi.arguments.CustomArgument< T, B >.CustomArgumentException.toCommandSyntax ( String  result,
CommandContext<?>  cmdCtx 
)

Converts this CustomArgumentException into a CommandSyntaxException.

Parameters
resultthe argument that the user entered that caused this exception to arise
cmdCtxthe command context that executed this command
Returns
a Brigadier CommandSyntaxException