CommandAPI 9.4.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender > Interface Template Reference

This class represents suggestions for an argument. More...

Public Member Functions

CompletableFuture< Suggestionssuggest (SuggestionInfo< CommandSender > info, SuggestionsBuilder builder) throws CommandSyntaxException
 Create a CompletableFuture resolving onto a brigadier Suggestions object. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > empty ()
 Suggest nothing. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > strings (String... suggestions)
 Suggest hardcoded strings. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > strings (Collection< String > suggestions)
 Suggest hardcoded strings. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > strings (Function< SuggestionInfo< CommandSender >, String[]> suggestions)
 Suggest an array of strings as the result of a function. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringCollection (Function< SuggestionInfo< CommandSender >, Collection< String > > suggestions)
 Suggest a collection of strings as the result of a function. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringsAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< String[]> > suggestions)
 Suggest an array of strings asynchronously. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringCollectionAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< String > > > suggestions)
 Suggest a collection of strings asynchronously. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringsWithTooltips (IStringTooltip... suggestions)
 Suggest hardcoded strings with tooltips. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringsWithTooltips (Collection< IStringTooltip > suggestions)
 Suggest hardcoded strings with tooltips. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringsWithTooltips (Function< SuggestionInfo< CommandSender >, IStringTooltip[]> suggestions)
 Suggest an array of strings with tooltips as the result of a function. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringsWithTooltipsCollection (Function< SuggestionInfo< CommandSender >, Collection< IStringTooltip > > suggestions)
 Suggest a collection of strings with tooltips as the result of a function. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringsWithTooltipsAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< IStringTooltip[]> > suggestions)
 Suggest an array of strings with tooltips asynchronously. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > stringsWithTooltipsCollectionAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< IStringTooltip > > > suggestions)
 Suggest a collection of strings with tooltips asynchronously. More...
 
static< CommandSender > ArgumentSuggestions< CommandSender > merge (ArgumentSuggestions< CommandSender >... suggestions)
 Merge suggestions from multiple ArgumentSuggestions together. More...
 

Detailed Description

This class represents suggestions for an argument.

ArgumentSuggestions objects are best created using the static methods as opposed to functionally.

Member Function Documentation

◆ empty()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.empty ( )

Suggest nothing.

Returns
an ArgumentSuggestions object suggesting nothing.

◆ merge()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.merge ( ArgumentSuggestions< CommandSender >...  suggestions)

Merge suggestions from multiple ArgumentSuggestions together.

Parameters
suggestionsThe ArgumentSuggestions to be merged
Returns
an ArgumentSuggestions object suggesting everything suggested by the input suggestions

◆ stringCollection()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringCollection ( Function< SuggestionInfo< CommandSender >, Collection< String > >  suggestions)

Suggest a collection of strings as the result of a function.

Parameters
suggestionsfunction providing the strings as a collection
Returns
an ArgumentSuggestions object suggesting the result of the function

◆ stringCollectionAsync()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringCollectionAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< String > > >  suggestions)

Suggest a collection of strings asynchronously.

Parameters
suggestionsfunction providing the collection of strings asynchronously
Returns
an ArgumentSuggestions object suggesting the result of the asynchronous function

◆ strings() [1/3]

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.strings ( Collection< String >  suggestions)

Suggest hardcoded strings.

Parameters
suggestionscollection of hardcoded strings
Returns
an ArgumentSuggestions object suggesting hardcoded strings

◆ strings() [2/3]

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.strings ( Function< SuggestionInfo< CommandSender >, String[]>  suggestions)

Suggest an array of strings as the result of a function.

Parameters
suggestionsfunction providing the strings as an array
Returns
an ArgumentSuggestions object suggesting the result of the function

◆ strings() [3/3]

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.strings ( String...  suggestions)

Suggest hardcoded strings.

Parameters
suggestionsarray of hardcoded strings
Returns
an ArgumentSuggestions object suggesting hardcoded strings

◆ stringsAsync()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringsAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< String[]> >  suggestions)

Suggest an array of strings asynchronously.

Parameters
suggestionsfunction providing the array of strings asynchronously
Returns
an ArgumentSuggestions object suggesting the result of the asynchronous function

◆ stringsWithTooltips() [1/3]

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringsWithTooltips ( Collection< IStringTooltip suggestions)

Suggest hardcoded strings with tooltips.

Parameters
suggestionscollection of hardcoded strings with tooltips
Returns
an ArgumentSuggestions object suggesting the hardcoded strings with tooltips

◆ stringsWithTooltips() [2/3]

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringsWithTooltips ( Function< SuggestionInfo< CommandSender >, IStringTooltip[]>  suggestions)

Suggest an array of strings with tooltips as the result of a function.

Parameters
suggestionsfunction providing the array of strings with tooltips
Returns
an ArgumentSuggestions object suggesting the result of the function

◆ stringsWithTooltips() [3/3]

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringsWithTooltips ( IStringTooltip...  suggestions)

Suggest hardcoded strings with tooltips.

Parameters
suggestionscollection of hardcoded strings with tooltips
Returns
an ArgumentSuggestions object suggesting the hardcoded strings with tooltips

◆ stringsWithTooltipsAsync()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringsWithTooltipsAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< IStringTooltip[]> >  suggestions)

Suggest an array of strings with tooltips asynchronously.

Parameters
suggestionsfunction providing the array of strings with tooltips asynchronously
Returns
an ArgumentSuggestions object suggesting the result of the asynchronous function

◆ stringsWithTooltipsCollection()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringsWithTooltipsCollection ( Function< SuggestionInfo< CommandSender >, Collection< IStringTooltip > >  suggestions)

Suggest a collection of strings with tooltips as the result of a function.

Parameters
suggestionsfunction providing the collection of strings with tooltips
Returns
an ArgumentSuggestions object suggesting the result of the function

◆ stringsWithTooltipsCollectionAsync()

static< CommandSender > ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.stringsWithTooltipsCollectionAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< IStringTooltip > > >  suggestions)

Suggest a collection of strings with tooltips asynchronously.

Parameters
suggestionsfunction providing the collection of strings with tooltips asynchronously
Returns
an ArgumentSuggestions object suggesting the result of the asynchronous function

◆ suggest()

CompletableFuture< Suggestions > dev.jorel.commandapi.arguments.ArgumentSuggestions< CommandSender >.suggest ( SuggestionInfo< CommandSender >  info,
SuggestionsBuilder  builder 
) throws CommandSyntaxException

Create a CompletableFuture resolving onto a brigadier Suggestions object.

Parameters
infoThe suggestions info
builderThe Brigadier SuggestionsBuilder object
Returns
a CompletableFuture resolving onto a brigadier Suggestions object.
Exceptions
CommandSyntaxExceptionif there is an error making suggestions