Package dev.jorel.commandapi.arguments
Class CustomArgument.CustomArgumentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentException
- All Implemented Interfaces:
Serializable
- Enclosing class:
CustomArgument<T,B>
An exception used to create command-related errors for the CustomArgument
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCustomArgumentException(CustomArgument.MessageBuilder errorMessage) Deprecated, for removal: This API element is subject to removal in a future version.CustomArgumentException(String errorMessage) Deprecated, for removal: This API element is subject to removal in a future version.UsefromString(String)insteadCustomArgumentException(net.md_5.bungee.api.chat.BaseComponent[] errorMessage) Deprecated, for removal: This API element is subject to removal in a future version.UsefromBaseComponents(BaseComponent...)instead -
Method Summary
Modifier and TypeMethodDescriptionfromAdventureComponent(net.kyori.adventure.text.Component errorMessage) Constructs a CustomArgumentException with a given error messagefromBaseComponents(net.md_5.bungee.api.chat.BaseComponent[] errorMessage) Constructs a CustomArgumentException with a given error messagefromMessageBuilder(CustomArgument.MessageBuilder errorMessage) Constructs a CustomArgumentException with a given error messagefromString(String errorMessage) Constructs a CustomArgumentException with a given error messagecom.mojang.brigadier.exceptions.CommandSyntaxExceptiontoCommandSyntax(String result, com.mojang.brigadier.context.CommandContext<?> cmdCtx) Converts this CustomArgumentException into a CommandSyntaxExceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CustomArgumentException
@Deprecated(since="9.0.1", forRemoval=true) public CustomArgumentException(net.md_5.bungee.api.chat.BaseComponent[] errorMessage) Deprecated, for removal: This API element is subject to removal in a future version.UsefromBaseComponents(BaseComponent...)insteadConstructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
CustomArgumentException
Deprecated, for removal: This API element is subject to removal in a future version.UsefromString(String)insteadConstructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
CustomArgumentException
@Deprecated(since="9.0.1", forRemoval=true) public CustomArgumentException(CustomArgument.MessageBuilder errorMessage) Deprecated, for removal: This API element is subject to removal in a future version.UsefromMessageBuilder(MessageBuilder)insteadConstructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
-
Method Details
-
fromBaseComponents
public static CustomArgument.CustomArgumentException fromBaseComponents(net.md_5.bungee.api.chat.BaseComponent[] errorMessage) Constructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
fromString
Constructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
fromAdventureComponent
public static CustomArgument.CustomArgumentException fromAdventureComponent(net.kyori.adventure.text.Component errorMessage) Constructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
fromMessageBuilder
public static CustomArgument.CustomArgumentException fromMessageBuilder(CustomArgument.MessageBuilder errorMessage) Constructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
toCommandSyntax
public com.mojang.brigadier.exceptions.CommandSyntaxException toCommandSyntax(String result, com.mojang.brigadier.context.CommandContext<?> cmdCtx) Converts this CustomArgumentException into a CommandSyntaxException- Parameters:
result- the argument that the user entered that caused this exception to arisecmdCtx- the command context that executed this command- Returns:
- a Brigadier CommandSyntaxException
-
fromMessageBuilder(MessageBuilder)instead