Open Esophose opened 3 years ago
Just for clarity, the issue here is with inner node aliases. Root node aliases work fine.
Working example (root node aliases):
/example
and /ex
Example with issue (inner node aliases):
/example test
and /example testalias
I noticed this too and thought it was intentional. Personally I would do it like so:
Say my command is registered 'test' and alias is 'thetest', then /t will only suggest 'test' and typing /th will only suggest 'thetest'.
Was not aware this was only an issue with brigadier though.
I noticed this too and thought it was intentional. Personally I would do it like so:
- Only show the non-aliases as suggestions by default
- If none match with user input, only then consider aliases and show those.
Say my command is registered 'test' and alias is 'thetest', then /t will only suggest 'test' and typing /th will only suggest 'thetest'.
Was not aware this was only an issue with brigadier though.
Brigadier would then show the entire command chain as invalid, as it's not aware of the alias literals. The literal suggestions are handled by the client. This would require the use of a custom argument.
Aliases of literal arguments do not show up in the command suggestions for Brigadier. The commands do, however, still work if you use the aliases. I had a little chat on the Discord server with a couple of the devs and found that this is intentional due to polluting the Brigadier command node map. I would recommend either documenting that this is intentional somewhere (the wiki perhaps?), or maybe add an option to enable this functionality explicitly since it has downsides.
Example code: https://pastebin.com/71hT3fSW Gif of executing the command with suggestions: https://gyazo.com/c78e08a403f6e95194e1574167e70990