I have problems using RegisterCommandsEvent. Below is inside a EventBusSubscriber.
@SubscribeEvent
public static void onRegisterCommands(final RegisterCommandsEvent event) {
HelloWorldCommand.register(event.getDispatcher());
}
This gives me this error.
Failure message: Chants (chants) has failed to load correctly
java.lang.IllegalArgumentException: Method public static void com.name.chants.ModEventSubscriber.onServerStarting(net.minecraftforge.event.RegisterCommandsEvent) has @SubscribeEvent annotation, but takes an argument that is not a subtype of the base type interface net.minecraftforge.fml.event.lifecycle.IModBusEvent: class net.minecraftforge.event.RegisterCommandsEvent
I heard that FMLServerStartingEvent was replaced with RegisterCommandsEvent for custom commands, but I couldn't find an example anywhere.
Can I have a couple of examples of command registration using RegisterCommandsEvent?