MultiLiteralArgument returns null parsedArgument on 11.0.1-SNAPSHOT · Issue #673 · CommandAPI/CommandAPI · GitHub
Skip to content

MultiLiteralArgument returns null parsedArgument on 11.0.1-SNAPSHOT #673

Description

@FastJoe0

CommandAPI version

11.0.1-SNAPSHOT

Minecraft version

1.21.10

Are you shading the CommandAPI?

Yes

What I did

When using MultiLiteralArgument in CommandAPI 11.0.1-SNAPSHOT (tested on Paper 1.21.10), executing the command causes a NullPointerException inside CommandAPIHandler#getRawArgumentInput.

The issue seems to be that parsedArgument is null for MultiLiteralArgument, even though the argument is correctly registered and visible in tab completion.

Minimal reproducible example:

@Override
public void onEnable() {
    CommandAPI.onEnable();

    new CommandAPICommand("changegamemode")
        .withArguments(new MultiLiteralArgument("gamemodes", "survival", "creative", "adventure", "spectator"))
        .executes((sender, args) -> {
            String gm = (String) args.get("gamemodes");
            sender.sendMessage("Selected: " + gm);
        })
        .register();
}

This issue does not occur in CommandAPI 11.0.0 - the same code works correctly there. It only happens in 11.0.1-SNAPSHOT.

What actually happened

Steps to reproduce:

  1. Run a Paper 1.21.10 server with CommandAPI 11.0.1-SNAPSHOT (commandapi-paper-shade)
  2. Load the above plugin
  3. Execute /changegamemode creative

What should have happened

The command should execute normally and return "Selected: creative", without throwing any exception.

Server logs and CommandAPI config

https://pastes.dev/JN6RzO4Emx

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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