-
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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:
- Run a Paper 1.21.10 server with CommandAPI 11.0.1-SNAPSHOT (commandapi-paper-shade)
- Load the above plugin
- 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
Other
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working