Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MysteriousHacks

Members
  • Joined

  • Last visited

Everything posted by MysteriousHacks

  1. Hey modder community, I just don't understand what is wrong with my code. I nearly tried everything to fix my problem but the LivingHurtEvent still does not work on servers. Thats my code: Main Class: @SidedProxy(clientSide = "PACKAGE_NAME_IS_CORRECT.ClientProxy", serverSide = "PACKAGE_NAME_IS_CORRECT.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(event); } @EventHandler public void onInit(FMLInitializationEvent event) { proxy.onInit(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } CommonProxy: public class CommonProxy { public void preInit(FMLPreInitializationEvent event) {} public void onInit(FMLInitializationEvent event) {} public void postInit(FMLPostInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new EntityHurtListener()); } } ClientProxy: @Override public void preInit(FMLPreInitializationEvent event) { super.preInit(event); } @Override public void onInit(FMLInitializationEvent event) { super.onInit(event); } @Override public void postInit(FMLPostInitializationEvent event) { super.postInit(event); // BLABLA CLIENTSIDE STUFF SUCH AS KEYBINDS, OTHER EVENTS } EntityHurtListener: public class EntityHurtListener { private static final Logger logger = LogManager.getLogger(); @SubscribeEvent public void onLivingHurt(LivingHurtEvent e) { logger.info("LivingHurtEvent"); System.out.println("LivingHurtEvent"); } } As you can see, I registered the event the postInit() of CommonProxy. I also tried registering in init(), aswell as the ClientProxy (init and postInit). My event is working fine for Slimes on SinglePlayer (couldn't test with playerEntities) but as I said it's not getting fired in any way. Please help me, I already read the source code of many mods but still couldn't find my error. Thanks

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.