public interface Argument
Modifier and Type | Method and Description |
---|---|
default <T> @Nullable com.mojang.brigadier.arguments.ArgumentType<T> |
getArgumentType()
Returns the brigadier argument type, if the argument is required.
|
@NotNull List<Argument> |
getChildren()
Returns unmodifiable copy of the children this argument is holding.
|
@NotNull String |
getName()
Returns the name of the argument.
|
default @Nullable Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> |
getSuggestionsConsumer()
Returns the
SuggestionsBuilder consumer, which is able to modify the suggestions for
this argument. |
default boolean |
isLiteral()
Returns whether or not this argument is literal.
|
boolean |
shouldExecuteCommand()
Returns whether or not this argument should call the base command's execute method when the
argument ends up being the last typed argument.
|
@NotNull @NotNull String getName()
@Nullable default <T> @Nullable com.mojang.brigadier.arguments.ArgumentType<T> getArgumentType()
A literal argument does not have a dedicated argument type, and this will return null if the argument is literal.
T
- the type held by the argument type.default boolean isLiteral()
true
if literal, false
otherwise@Nullable default @Nullable Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> getSuggestionsConsumer()
SuggestionsBuilder
consumer, which is able to modify the suggestions for
this argument. By default, this returns null.
We do not suggest using suggestions builder to add your suggestions. Instead, use literal arguments with combination with a required one
boolean shouldExecuteCommand()
true
if should have execute, false
otherwise@NotNull @NotNull List<Argument> getChildren()
Copyright © 2020. All rights reserved.