DynamicListStringCommandArgument

A ListStringCommandArgument whose valid values are re-read on every use instead of being snapshotted when the command is registered.

Use this for values backed by reloadable configs (bosses, items, wormholes, quests...). A plain ListStringCommandArgument built from a config collection at registration time goes stale as soon as content is imported or reloaded, which makes freshly added entries fail command validation with "not recognized" until the next full restart.

Constructors

Link copied to clipboard
public void DynamicListStringCommandArgument(Supplier<List<String>> validValuesSupplier, String hint)

Inherited properties

Link copied to clipboard
protected String hint
Link copied to clipboard
protected final List<String> validValues

Functions

Link copied to clipboard
public List<String> getSuggestions(CommandSender sender, String partialInput)
Link copied to clipboard
public List<String> literals()
Link copied to clipboard
public boolean matchesInput(String input)

Inherited functions

Link copied to clipboard
public String hint()
Link copied to clipboard
public boolean isLiteral()
Link copied to clipboard
public boolean isOptional()
Whether this argument may be omitted by the user.
Link copied to clipboard
public boolean isVarargs()
Whether this definition consumes every remaining command-line token.