Class PlayerArgument
java.lang.Object
com.mrivanplays.ivancord.api.command.arguments.PlayerArgument
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>
public class PlayerArgument
extends Object
implements com.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>
A BungeeCord implementation of the
minecraft:game_profile
argument
Drawbacks:
- Selector
@ereturns all players rather than all entities - Selector
@swill return an empty list. - Selectors doesn't support options
As all drawbacks are about the selector, so that's why we've added an option to disable parsing selectors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionType -
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerArgumentstatic Collection<PlayerArgument.ProtoPlayer>getPlayers(com.mojang.brigadier.context.CommandContext<?> context, String name) <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) parse(com.mojang.brigadier.StringReader reader) static PlayerArgumentplayer()static PlayerArgumentplayer(boolean allowSelectors)
-
Field Details
-
UNKNOWN_PLAYER
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType UNKNOWN_PLAYER -
SELECTOR_UNKNOWN
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType SELECTOR_UNKNOWN -
SELECTOR_NOT_ENABLED
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType SELECTOR_NOT_ENABLED
-
-
Method Details
-
player
-
disableSelectors
-
player
-
getPlayers
public static Collection<PlayerArgument.ProtoPlayer> getPlayers(com.mojang.brigadier.context.CommandContext<?> context, String name) -
parse
public PlayerArgument.Result parse(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parsein interfacecom.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listSuggestions
public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) - Specified by:
listSuggestionsin interfacecom.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>
-
getExamples
- Specified by:
getExamplesin interfacecom.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>
-