Fabric API

Fabric API

112M Downloads

[Suggestion] Better Command API

LoboMetalurgico opened this issue ยท 4 comments

commented

Mojang brigadier is... weird. It has no optional arguments and to create it you need to repeat the code for each different behavior based on whether or not it has a certain argument (see /TP command). Command aliases are another complicated thing to understand and do.

Therefore, I would like to suggest a new command API, similar to what other server software such as Bukkit/Spigot/Paper, Sponge, Bungeecord/Waterfall, Velocity, and others have

This would make mod development simpler, as well as attract more people to the Fabric Ecosystem, as many avoid it due to the complexity of creating commands and events.

commented

I agree, this is out of scope for Fabric API. There is nothing stopping a 3rd party library to do this.

commented

Actually OptionalArgumentType would be very useful, should I open a new issue?

commented

I don't know how it would function without adding a proper backtracking. Also, adding a new argument type breaks vanilla clients.

commented

Fabric API is designed to improve mod compatibility and eliminate copy-paste code. What you are proposing is not part of FAPI's goals.

Bukkit/Spigot/Paper Command API in my opinion is much worse and less flexible than Brigadier API, but the optional argument idea makes sense, perhaps FAPI should have an ArgumentType wrapper called OptionalArgumentType