CommandAPI 9.5.2
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.ListArgumentBuilder< T > Class Template Reference

A builder to create a ListArgument. More...

Classes

class  ListArgumentBuilderSuggests
 An intermediary class for the ListArgumentBuilder. More...
 

Public Member Functions

 ListArgumentBuilder (String nodeName)
 Creates a new ListArgumentBuilder with a specified node name. More...
 
 ListArgumentBuilder (String nodeName, String delimiter)
 Creates a new ListArgumentBuilder with a specified node name. More...
 
ListArgumentBuilder< T > allowDuplicates (boolean allowDuplicates)
 Whether duplicates are allowed in the provided list. More...
 
ListArgumentBuilderSuggests withList (Function< SuggestionInfo< CommandSender >, Collection< T > > list)
 Specifies the list to use to generate suggestions for the list argument. More...
 
ListArgumentBuilderSuggests withList (Supplier< Collection< T > > list)
 Specifies the list to use to generate suggestions for the list argument. More...
 
ListArgumentBuilderSuggests withList (Collection< T > list)
 Specifies the list to use to generate suggestions for the list argument. More...
 
final ListArgumentBuilderSuggests withList (T... array)
 Specifies the list to use to generate suggestions for the list argument. More...
 

Detailed Description

A builder to create a ListArgument.

Parameters
<T>the type that the list argument generates a list of.

Constructor & Destructor Documentation

◆ ListArgumentBuilder() [1/2]

Creates a new ListArgumentBuilder with a specified node name.

Defaults the delimiter for each element in the list to a space

Parameters
nodeNamethe name of the node for this argument

◆ ListArgumentBuilder() [2/2]

dev.jorel.commandapi.arguments.ListArgumentBuilder< T >.ListArgumentBuilder ( String  nodeName,
String  delimiter 
)

Creates a new ListArgumentBuilder with a specified node name.

Parameters
nodeNamethe name of the node for this argument
delimiterthe separator for each element in the list (for example, a space or a comma)

Member Function Documentation

◆ allowDuplicates()

ListArgumentBuilder< T > dev.jorel.commandapi.arguments.ListArgumentBuilder< T >.allowDuplicates ( boolean  allowDuplicates)

Whether duplicates are allowed in the provided list.

By default, duplicates are not allowed.

Parameters
allowDuplicateswhether to enable duplicates or not
Returns
this list argument builder

◆ withList() [1/4]

Specifies the list to use to generate suggestions for the list argument.

Parameters
lista collection of elements to suggest for this list argument
Returns
this list argument builder

◆ withList() [2/4]

ListArgumentBuilderSuggests dev.jorel.commandapi.arguments.ListArgumentBuilder< T >.withList ( Function< SuggestionInfo< CommandSender >, Collection< T > >  list)

Specifies the list to use to generate suggestions for the list argument.

Parameters
lista function that accepts a SuggestionInfo and returns a collection of elements to suggest for this list argument
Returns
this list argument builder

◆ withList() [3/4]

ListArgumentBuilderSuggests dev.jorel.commandapi.arguments.ListArgumentBuilder< T >.withList ( Supplier< Collection< T > >  list)

Specifies the list to use to generate suggestions for the list argument.

Parameters
lista supplier that returns a collection of elements to suggest for this list argument
Returns
this list argument builder

◆ withList() [4/4]

Specifies the list to use to generate suggestions for the list argument.

Parameters
arrayan array of elements to suggest for this list argument
Returns
this list argument builder