Posted October 15, 20205 yr 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?
October 17, 20205 yr Author On 10/15/2020 at 4:21 AM, diesieben07 said: You registered it to the wrong event bus. Can I have an example?
October 17, 20205 yr It's on forge eventbus not mod. https://mcforge.readthedocs.io/en/latest/events/intro/ Edited October 17, 20205 yr by poopoodice
December 22, 20204 yr Author On 10/17/2020 at 2:45 AM, poopoodice said: It's on forge eventbus not mod. https://mcforge.readthedocs.io/en/latest/events/intro/ Is it @Forge.EventBusSubscriber() or @Forge.SubscribeEvent?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.