Emergency Release as I messed up and neither the Modrinth page nor Curseforge were done.
How to for Modders:
Commands can be registered 2 way, either by sending your commands over with the IMC system,
or by requesting to get the CommandDispatcher over IMC.
The latter is easier to use if you've got multiple commands.
You can just create your commands the same way as you would for normal Commands.
However, both the world and server of the CommandSource will be null!
Here's an example of the IMC system, the event is registered on the Mod Bus:
private static void enqueueIMC(InterModEnqueueEvent event){
//Registering single commands expects a 'LiteralArgumentBuilder<?>'
InterModComms.sendTo("clientcommands", "register_command", () -> /* command instance */);
//Registering commands using a callback expects a 'Consumer<CommandDispatcher<CommandSource>>'
InterModComms.sendTo("clientcommands", "register_commands", () -> this::registerCommands);
}
private static void registerCommands(CommandDispatcher<CommandSource> commandDispatcher){
//register your commands to the dispatcher
}