@EventBusSubscriber(modid = MODID) // Automatic registration
public class EventHandlingClass {
@SubscribeEvent // method handles an event
public static void handleAnEvent(SomeEvent event) {
...
}
}
If you don't use @EventBusSubscriber and static methods, you have to explicitly register the class, instance or method.
https://docs.minecraftforge.net/en/latest/concepts/events/