CommandAPI  6.0.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.IOverrideableSuggestions Interface Reference

An interface declaring methods required to override argument suggestions. More...

+ Inheritance diagram for dev.jorel.commandapi.arguments.IOverrideableSuggestions:

Public Member Functions

Argument overrideSuggestions (String... suggestions)
 Override the suggestions of this argument with a String array. More...
 
Argument overrideSuggestions (Collection< String > suggestions)
 
Argument overrideSuggestions (Function< CommandSender, String[]> suggestions)
 Override the suggestions of this argument with a function that maps the command sender to a String array. More...
 
Argument overrideSuggestions (BiFunction< CommandSender, Object[], String[]> suggestions)
 Override the suggestions of this argument with a function that maps the command sender to a String array. More...
 
Optional< Function< SuggestionInfo, IStringTooltip[]> > getOverriddenSuggestions ()
 Returns a function that maps the command sender to a String array of suggestions for the current command, or null if this is not overridden. More...
 
Argument overrideSuggestionsT (IStringTooltip... suggestions)
 Override the suggestions of this argument with an array of StringTooltips, that represents the String suggestion and a hover tooltip. More...
 
Argument overrideSuggestionsT (Collection< IStringTooltip > suggestions)
 Override the suggestions of this argument with a collection of StringTooltips, that represents the String suggestion and a hover tooltip. More...
 
Argument overrideSuggestionsT (Function< CommandSender, IStringTooltip[]> suggestions)
 Override the suggestions of this argument with a function mapping the command sender to an array of StringTooltips, that represents the String suggestion and a hover tooltip. More...
 
Argument overrideSuggestionsT (BiFunction< CommandSender, Object[], IStringTooltip[]> suggestions)
 Override the suggestions of this argument with a function mapping the command sender and previously declared arguments to an array of StringTooltips, that represents the String suggestion and a hover tooltip. More...
 
Argument replaceSuggestions (Function< SuggestionInfo, String[]> suggestions)
 
Argument replaceSuggestionsT (Function< SuggestionInfo, IStringTooltip[]> suggestions)
 

Detailed Description

An interface declaring methods required to override argument suggestions.

Member Function Documentation

◆ getOverriddenSuggestions()

Optional<Function<SuggestionInfo, IStringTooltip[]> > dev.jorel.commandapi.arguments.IOverrideableSuggestions.getOverriddenSuggestions ( )

Returns a function that maps the command sender to a String array of suggestions for the current command, or null if this is not overridden.

Returns
a function that provides suggestions, or null if there are no overridden suggestions.

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestions() [1/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestions ( BiFunction< CommandSender, Object[], String[]>  suggestions)

Override the suggestions of this argument with a function that maps the command sender to a String array.

Parameters
suggestionsthe function to override suggestions with
Returns
the current argument

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestions() [2/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestions ( Collection< String >  suggestions)
Deprecated:
use Argument#overrideSuggestions(Function)
Parameters
suggestionsa collection of strings to override suggestions with

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestions() [3/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestions ( Function< CommandSender, String[]>  suggestions)

Override the suggestions of this argument with a function that maps the command sender to a String array.

Parameters
suggestionsthe function to override suggestions with
Returns
the current argument

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestions() [4/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestions ( String...  suggestions)

Override the suggestions of this argument with a String array.

Typically, this is the supplier s -> suggestions.

Parameters
suggestionsthe string array to override suggestions with
Returns
the current argument
Deprecated:
use Argument#overrideSuggestions(Function)

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestionsT() [1/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestionsT ( BiFunction< CommandSender, Object[], IStringTooltip[]>  suggestions)

Override the suggestions of this argument with a function mapping the command sender and previously declared arguments to an array of StringTooltips, that represents the String suggestion and a hover tooltip.

Parameters
suggestionsthe suggestions and tooltips to override suggestions with
Returns
the current argument

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestionsT() [2/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestionsT ( Collection< IStringTooltip suggestions)

Override the suggestions of this argument with a collection of StringTooltips, that represents the String suggestion and a hover tooltip.

Parameters
suggestionsthe suggestions and tooltips to override suggestions with
Returns
the current argument
Deprecated:
use Argument#overrideSuggestionsT(Function)

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestionsT() [3/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestionsT ( Function< CommandSender, IStringTooltip[]>  suggestions)

Override the suggestions of this argument with a function mapping the command sender to an array of StringTooltips, that represents the String suggestion and a hover tooltip.

Parameters
suggestionsthe suggestions and tooltips to override suggestions with
Returns
the current argument

Implemented in dev.jorel.commandapi.arguments.Argument.

◆ overrideSuggestionsT() [4/4]

Argument dev.jorel.commandapi.arguments.IOverrideableSuggestions.overrideSuggestionsT ( IStringTooltip...  suggestions)

Override the suggestions of this argument with an array of StringTooltips, that represents the String suggestion and a hover tooltip.

Parameters
suggestionsthe suggestions and tooltips to override suggestions with
Returns
the current argument
Deprecated:
use Argument#overrideSuggestionsT(Function)

Implemented in dev.jorel.commandapi.arguments.Argument.