Class ArgumentEntity
java.lang.Object
net.minestom.server.command.builder.arguments.Argument<EntityFinder>
net.minestom.server.command.builder.arguments.minecraft.ArgumentEntity
Represents the target selector argument.
https://minecraft.wiki/w/Target_selectors
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, CONTAINER, suggestionType, useRemaining -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbyte @Nullable []onlyPlayers(boolean onlyPlayers) @NotNull EntityFinderparse(@NotNull CommandSender sender, @NotNull String input) Parses the given input, and throw anArgumentSyntaxExceptionif the input cannot be converted toTparser()singleEntity(boolean singleEntity) static @NotNull EntityFinderstaticParse(@NotNull CommandSender sender, @NotNull String input, boolean onlySingleEntity, boolean onlyPlayers) Deprecated.toString()Methods inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, equals, filter, getCallback, getDefaultValue, getId, getSuggestionCallback, hasErrorCallback, hashCode, hasSuggestion, isOptional, map, map, parse, setCallback, setDefaultValue, setDefaultValue, setDefaultValue, setSuggestionCallback, suggestionType, useRemaining
-
Field Details
-
INVALID_SYNTAX
public static final int INVALID_SYNTAX- See Also:
-
ONLY_SINGLE_ENTITY_ERROR
public static final int ONLY_SINGLE_ENTITY_ERROR- See Also:
-
ONLY_PLAYERS_ERROR
public static final int ONLY_PLAYERS_ERROR- See Also:
-
INVALID_ARGUMENT_NAME
public static final int INVALID_ARGUMENT_NAME- See Also:
-
INVALID_ARGUMENT_VALUE
public static final int INVALID_ARGUMENT_VALUE- See Also:
-
-
Constructor Details
-
ArgumentEntity
-
-
Method Details
-
singleEntity
-
onlyPlayers
-
parse
@NotNull public @NotNull EntityFinder parse(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String input) throws ArgumentSyntaxException Description copied from class:ArgumentParses the given input, and throw anArgumentSyntaxExceptionif the input cannot be converted toT- Specified by:
parsein classArgument<EntityFinder>- Parameters:
input- the argument to parse- Returns:
- the parsed argument
- Throws:
ArgumentSyntaxException- ifvalueis not valid
-
parser
- Specified by:
parserin classArgument<EntityFinder>
-
nodeProperties
public byte @Nullable [] nodeProperties()- Overrides:
nodePropertiesin classArgument<EntityFinder>
-
staticParse
@Deprecated @NotNull public static @NotNull EntityFinder staticParse(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String input, boolean onlySingleEntity, boolean onlyPlayers) throws ArgumentSyntaxException Deprecated.- Throws:
ArgumentSyntaxException
-
isOnlySingleEntity
public boolean isOnlySingleEntity() -
isOnlyPlayers
public boolean isOnlyPlayers() -
toString
-
Argument.parse(CommandSender, Argument)