Skip to content

MultiplePlayerSelector only parses one player #809

@kuraiwtf

Description

@kuraiwtf

Here is the code for my command:

public final class TestCommand {

  private static final String ARGUMENT = "players";

  @Command("test <" + ARGUMENT + ">")
  public void test(final CommandSourceStack sender, final @Argument(ARGUMENT) MultiplePlayerSelector selector) {
    if (!(sender.getSender() instanceof Player player)) return;
    for (final var value : selector.values()) {
      player.sendRichMessage(
          "<green> - </green> <gray><name></gray>",
          TagResolver.resolver("name", Tag.inserting(value.displayName())));
    }
  }
}

I also tried to add the @Greedy annotation to the MPS, but it still does not works.

However, when I try to target two players, only the first is allowed, the second does not even tab-complete.
Image
Image
I also can't use selectors like @a, @p, @e, ...
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions