8000 The CommandAPI doesn't safeguard against paths with duplicate node names. This leads to client crashes · Issue #312 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content
The CommandAPI doesn't safeguard against paths with duplicate node names. This leads to client crashes #312
Closed
@JorelAli

Description

@JorelAli

CommandAPI version

8.5.0

Minecraft version

1.19

Are you shading the CommandAPI?

No

What I did

  • Register the following command:
    new CommandAPICommand("broken1")
        .withArguments(new StringArgument("key"))
        .withArguments(new IntegerArgument("a"))
        .withArguments(new StringArgument("key"))
        .executesPlayer((player, objects) -> {
            System.out.println(objects[0] + ", " + objects[1] + ", " + objects[2]);
        })
        .register();
  • Type /broken1 str 123 str

What actually happened

Minecraft's client (the vanilla client, not the server) crashes and closes.

What should have happened

The command should be runnable

Server logs and CommandAPI config

No response

Other

This appears to be the case when there is a "gap" between arguments. The following (with two consecutive arguments with the same key) doesn't cause a crash:

new CommandAPICommand("broken")
    .withArguments(new StringArgument("key"))
    .withArguments(new StringArgument("key"))
    .executesPlayer((player, objects) -> {
        System.out.println(objects[0] + ", " + objects[1]);
    })
    .register();

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcritical bugA bug that should be fixed ASAPimplemented for next releaseThis has been implemented in the current dev build for the next public release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0