Insane96MCP Posted October 15, 2017 Posted October 15, 2017 I have those 2 simple subscribed events: @SubscribeEvent public void PlayerDropsEvent(PlayerDropsEvent event) { Entity entity = event.getEntity(); System.out.println("Drop " + entity); } @SubscribeEvent public void PlayerRespawnEvent(PlayerEvent.PlayerRespawnEvent event) { System.out.println(event.player); } But none of them are called, neither when the player dies and when he respawns Quote
Choonster Posted October 15, 2017 Posted October 15, 2017 Are you definitely registering your event handler properly? Post the registration code. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Insane96MCP Posted October 15, 2017 Author Posted October 15, 2017 It shouldn't since I have another LivingHurtEvent that workshttps://github.com/Insane-96/GalaxiteMod/tree/master/common/net/insane96mcp/galaxite Quote
Draco18s Posted October 15, 2017 Posted October 15, 2017 You have two Living Hurt events: https://github.com/Insane-96/GalaxiteMod/blob/master/common/net/insane96mcp/galaxite/lib/CustomEventHandler.java#L20-L21 https://github.com/Insane-96/GalaxiteMod/blob/master/common/net/insane96mcp/galaxite/lib/CustomEventHandler.java#L79 I'm going to bet that one of them works and the other doesn't. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Insane96MCP Posted October 15, 2017 Author Posted October 15, 2017 5 minutes ago, Draco18s said: You have two Living Hurt events: https://github.com/Insane-96/GalaxiteMod/blob/master/common/net/insane96mcp/galaxite/lib/CustomEventHandler.java#L20-L21 https://github.com/Insane-96/GalaxiteMod/blob/master/common/net/insane96mcp/galaxite/lib/CustomEventHandler.java#L79 I'm going to bet that one of them works and the other doesn't. But the second one is not registered. It's just a Method Quote
Choonster Posted October 15, 2017 Posted October 15, 2017 You register the Class object with the event bus, which means your event handler methods need to be static. The Forge documentation explains this in more detail here. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
wyn_price Posted October 15, 2017 Posted October 15, 2017 MinecraftForge.EVENT_BUS.register(CustomEventHandler.class); do MinecraftForge.EVENT_BUS.register(new CustomEventHandler()); Quote
Recommended Posts
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.