-
- All Implemented Interfaces:
-
dev.kotx.flylib.command.Argument
public final class EntityArgument<T extends Object> implements Argument<List<Entity>, T>
An argument that takes a player name or entity selector as input. If a player name that does not exist or an invalid selector is entered, an error will be displayed on the client side, and even if you try to execute it, it will not be accepted. Expected input:
PlayerName
@a
,@r
,@e[distance=..5]
-
-
Field Summary
Fields Modifier and Type Field Description private final ArgumentEntity
type
private final String
name
private final SuggestionAction<T>
suggestion
private final ContextAction<T>
action
-
Constructor Summary
Constructors Constructor Description EntityArgument(String name, Boolean enableSelector, Boolean enableEntities, SuggestionAction<T> suggestion, ContextAction<T> action)
-
Method Summary
Modifier and Type Method Description ArgumentEntity
getType()
Mojang Brigadier argument type. String
getName()
SuggestionAction<T>
getSuggestion()
ContextAction<T>
getAction()
Argument context action List<CraftEntity>
parse(CommandContext<CommandListenerWrapper> context, String key)
-
-
Constructor Detail
-
EntityArgument
EntityArgument(String name, Boolean enableSelector, Boolean enableEntities, SuggestionAction<T> suggestion, ContextAction<T> action)
- Parameters:
name
- Name of argument.enableSelector
- Enables the use of selectors.enableEntities
- Allows you to select an entity.suggestion
- Lambda expression for tab completion of its arguments.
-
-
Method Detail
-
getType
ArgumentEntity getType()
Mojang Brigadier argument type.
-
getSuggestion
SuggestionAction<T> getSuggestion()
-
getAction
ContextAction<T> getAction()
Argument context action
-
-
-
-