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) Constructs a CustomArgumentException with a given error messageCustomArgumentException(String errorMessage) Constructs a CustomArgumentException with a given error message -
Method Summary
Modifier and TypeMethodDescriptioncom.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
Constructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
CustomArgumentException
Constructs a CustomArgumentException with a given error message- Parameters:
errorMessage- the error message to display to the user when this exception is thrown
-
-
Method Details
-
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
-