I was reading through the docs and I don't understand where I am actually supposed to call MinecraftForge.EVENT_BUS.register(). I am trying to create an event handler for a LivingFallEvent to create a bouncing effect (think Tinkers' Construct Slime Boots) but I can't get the event to be called. I looked at Tinkers' github repo and found the related code but their SlimeBounceHandler class just confuses me.
@SubscribeEvent
public void OnFall(LivingFallEvent event) {
System.out.println("===== FALLING =======================================================");
}
Create in the main class a void method which takes an FMLInitializationEvent as the argument with the annotation @EventHandler. Put the register thing in that method.
Rollback Post to RevisionRollBack
97% of teenagers would cry if they saw Justin Bieber on top of a tower about to jump. If your the 3% who is sitting there with popcorn screaming "DO A BACKFLIP!", copy and paste this as your signature.
The second method is generally recommended. You can simply annotate classes and methods and don't need to register them explicitly. As mentioned the methods need to be static. The whole class should be annotated with @EventBusSubscriber(modid = "YourModID") but you still need to also annotate the methods (same as before with old register approach) with @SubscribeEvent.
I was reading through the docs and I don't understand where I am actually supposed to call MinecraftForge.EVENT_BUS.register(). I am trying to create an event handler for a LivingFallEvent to create a bouncing effect (think Tinkers' Construct Slime Boots) but I can't get the event to be called. I looked at Tinkers' github repo and found the related code but their SlimeBounceHandler class just confuses me.
Create in the main class a void method which takes an FMLInitializationEvent as the argument with the annotation @EventHandler. Put the register thing in that method.
97% of teenagers would cry if they saw Justin Bieber on top of a tower about to jump. If your the 3% who is sitting there with popcorn screaming "DO A BACKFLIP!", copy and paste this as your signature.
The second method is generally recommended. You can simply annotate classes and methods and don't need to register them explicitly. As mentioned the methods need to be static. The whole class should be annotated with @EventBusSubscriber(modid = "YourModID") but you still need to also annotate the methods (same as before with old register approach) with @SubscribeEvent.