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
@e
returns all players rather than all entities - Selector
@s
will 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 class
static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
-
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerArgument
static 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 PlayerArgument
player()
static PlayerArgument
player
(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:
parse
in 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:
listSuggestions
in interfacecom.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>
-
getExamples
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>
-