Custom Arguments for Plugin Development
I am working on plugin development and spent a lot of time on commands recently. I realised that there is a heavy vanilla limitation that prevents server plugin developers from making custom arguments.
String arguments are always limited be be either a string, text or greedy string. None of those argument types match an input like an email adress without quoting it. This of course works fine for all vanilla implementations, but it makes it impossible to write custom argument inputs with special characters but without using greedy strings.
For example, I wrote a custom player selector for a proxy player object. It would look like @g[name="player"]. To parse this input, the underlying vanilla argument would have to be a greedy string, to prevent the requirement of quotation. Greedy strings are then inadequate because they don't allow any other arguments afterwards.
If I were to make a command `/tp @g[name="player"] ^ ^5 ^`, it would not be possible with the argument types provided by Brigadier or Vanilla Minecraft, except for making everything one large greedy string and splitting and parsing it manually, which is what many command frameworks currently do. This removes all argument highlighting and proper argument exception handling.
Therefore I want to suggest a custom argument type, like "minecraft:custom" or "minecraft:server_command", that supports all characters except for a space and allows plugin programmers to write custom arguments within the vanilla command framework.
Please sign in to leave a comment.