CommandAPI 9.3.0
An API for the command UI introduced in Minecraft 1.13
com.mojang.brigadier.exceptions.DynamicCommandExceptionType Class Reference

A CommandExceptionType taking one input and returning a message based on it. More...

+ Inheritance diagram for com.mojang.brigadier.exceptions.DynamicCommandExceptionType:

Public Member Functions

 DynamicCommandExceptionType (final Function< Object, Message > function)
 
CommandSyntaxException create (final Object arg)
 Creates a CommandSyntaxException using the passed argument. More...
 
CommandSyntaxException createWithContext (final ImmutableStringReader reader, final Object arg)
 Creates a CommandSyntaxException using the passed argument and includes information about the position and input. More...
 

Detailed Description

A CommandExceptionType taking one input and returning a message based on it.

The argument can be used to e.g. format a message and display the input as well as why it did not match some criteria.

Member Function Documentation

◆ create()

CommandSyntaxException com.mojang.brigadier.exceptions.DynamicCommandExceptionType.create ( final Object  arg)

Creates a CommandSyntaxException using the passed argument.

Parameters
argthe argument
Returns
a constructed CommandSyntaxException

◆ createWithContext()

CommandSyntaxException com.mojang.brigadier.exceptions.DynamicCommandExceptionType.createWithContext ( final ImmutableStringReader  reader,
final Object  arg 
)

Creates a CommandSyntaxException using the passed argument and includes information about the position and input.

Parameters
readerthe ImmutableStringReader giving information about the input and the place the error occurred
argthe argument
Returns
a constructed CommandSyntaxException