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.

  • 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

      public static PlayerArgument player()
    • disableSelectors

      public static PlayerArgument disableSelectors()
    • player

      public static PlayerArgument player(boolean allowSelectors)
    • 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 interface com.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 interface com.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>
    • getExamples

      public Collection<String> getExamples()
      Specified by:
      getExamples in interface com.mojang.brigadier.arguments.ArgumentType<PlayerArgument.Result>