However, the resulting Brigadier command tree looks like this:
literal "reputation"
offline player "player"
literal "good"
Other
I might be wrong, but I think this happens because o.i.c.brigadier.node.LiteralBrigadierNodeFactory#constructCommandNode(CommandNode<C>, BrigadierPermissionChecker<C>, com.mojang.brigadier.Command<S>) creates a literal node for the component name only, ignoring its aliases:
And then in LiteralBrigadierNodeFactory#createLiteralArgumentBuilder(CommandComponent<C>, CommandNode<C>, BrigadierPermissionChecker<C>):
private @NonNull ArgumentBuilder<S, ?> createLiteralArgumentBuilder(
final @NonNull CommandComponent<C> component,
final @NonNull CommandNode<C> root,
final @NonNull BrigadierPermissionChecker<C> permissionChecker
) {
return LiteralArgumentBuilder.<S>literal(component.name()) // <--- aliases not used
.requires(this.requirement(root, permissionChecker));
}
One possible fix would be making constructCommandNode(...) return a list of ArgumentBuilders which would work well with Brigadier node's then(...) method
But I might be wrong about why this happens, so ¯\_(ツ)_/¯
Steps to reproduce
Here's an example command:
Expected behavior
Expected command tree:
Observed behavior
However, the resulting Brigadier command tree looks like this:
Other
I might be wrong, but I think this happens because
o.i.c.brigadier.node.LiteralBrigadierNodeFactory#constructCommandNode(CommandNode<C>, BrigadierPermissionChecker<C>, com.mojang.brigadier.Command<S>)
creates a literal node for the component name only, ignoring its aliases:And then in
LiteralBrigadierNodeFactory#createLiteralArgumentBuilder(CommandComponent<C>, CommandNode<C>, BrigadierPermissionChecker<C>)
:One possible fix would be making
constructCommandNode(...)
return a list ofArgumentBuilder
s which would work well with Brigadier node'sthen(...)
methodBut I might be wrong about why this happens, so ¯\_(ツ)_/¯