Skip to content

Conversation

@Rossterd
Copy link
Contributor

@Rossterd Rossterd commented Nov 28, 2025

Currently if you have the following command

var command = new BrigadierCommand(
        literalArgumentBuilder("vtestcommand")
                .then(literalArgumentBuilder("child")
                        .then(literalArgumentBuilder("grandchild")
                                .executes(ctx -> {
                                    ctx.getSource().sendMessage(text("grandchild response"));
                                    return 1;
                                })
                        )
                )
);

/root and /root child get forwarded to the backend and handled there, but /root nonexistant gets handled on the proxy. This is because the former cause "UnknownCommand" exceptions, and the later causes an "UnknownArgument" exception.

The first commit in this PR aligns that behaviour, however this causes breakages in Simple/Raw commands as those assume they get handled on the proxy even if the user doesn't have the requisite permission. Which isn't true anymore if we are forwarding invocations that cause a "UnknownArgument" exception. this test fails for example.

Currently I have resolved this by adding an toggle in the CommandMeta that decides whether partially-matching commands such as the ones above should be forwarded. The default is false to ensure all Simple- and RawCommands keep working as expected. I assume this will also cause the least amount of breakage in people's Brigadier commands, but there will still be some.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant