Posted April 29, 20205 yr Can't find a way to reopen thread. This problem still persists, using 1.15.2!
April 29, 20205 yr Post your code, preferrably as a github repo, and debug.log as well, it should give us enough info to figure out why it's not working
April 29, 20205 yr Author 9 minutes ago, Ugdhar said: Post your code, preferrably as a github repo, and debug.log as well, it should give us enough info to figure out why it's not working https://pastebin.com/5VUf4rXC I hope you can see how it should be working, but its not. Also, idk debug.log, but it just doesn't do the System.out.println() at all. Nothing. And in this thread again: This event is supposed to call when I get knockback, right? So e.g a player punch me?
April 29, 20205 yr @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent public void onKb (LivingKnockBackEvent e) { So, two problems. 1) You're using the wrong bus 2) your method isn't static 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.
April 30, 20205 yr Author 11 hours ago, Draco18s said: @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent public void onKb (LivingKnockBackEvent e) { So, two problems. 1) You're using the wrong bus 2) your method isn't static So what should I use? Basically every other events work perfectly in that class, except for that one.
April 30, 20205 yr 25 minutes ago, Scholler said: So what should I use? Basically every other events work perfectly in that class, except for that one. There are basically two buses to choose from: https://mcforge.readthedocs.io/en/1.15.x/events/intro/ You can figure it out.
April 30, 20205 yr Author 8 hours ago, Boy132 said: There are basically two buses to choose from: https://mcforge.readthedocs.io/en/1.15.x/events/intro/ You can figure it out. Didn't test it yet, but why wouldn't this event bus work? ._.
April 30, 20205 yr 36 minutes ago, Scholler said: Didn't test it yet, but why wouldn't this event bus work? ._. Think of an event bus like an email address. If you only get work related emails at your work address, then write a bot to tell you when you have new messages from your boss, but tell it to check your personal email address. Would you expect it to work? No? Why not? 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.
April 30, 20205 yr Author 32 minutes ago, Draco18s said: Think of an event bus like an email address. If you only get work related emails at your work address, then write a bot to tell you when you have new messages from your boss, but tell it to check your personal email address. Would you expect it to work? No? Why not? OK I GET IT
April 30, 20205 yr Author 22 hours ago, Scholler said: And in this thread again: This event is supposed to call when I get knockback, right? So e.g a player punch me? Can someone confirm this?
April 30, 20205 yr I said you had two problems. Did you fix both? 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.
April 30, 20205 yr Author 7 minutes ago, Draco18s said: I said you had two problems. Did you fix both? Where am I supposed to put ,,static'' ?
April 30, 20205 yr 23 hours ago, Draco18s said: 2) your method isn't static https://lmgtfy.com/?q=java+static+method 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.
April 30, 20205 yr Author 1 hour ago, Draco18s said: https://lmgtfy.com/?q=java+static+method Not working.
April 30, 20205 yr Author 34 minutes ago, diesieben07 said: Post updated code instead of just barking "not working, spoonfeed me more code". I'm trying to get this to work, been trying for more than one day now, and I'm not asking for any code. Probably you think I'm stupid, well, I'm not. Actually you still didn't answer my question, where I asked if this event should get called when I get hit in game, so I take knockback, because I don't see why wouldn't this work. If you want the code, there: https://pastebin.com/EuZkaUUe. AND if you really want to reply, you should help, not insult me or think that I'm so stupid I don't even know what's static method, or if you can't reply normally, then just don't, dear Forum Team member. Edited April 30, 20205 yr by Scholler Added important detail
April 30, 20205 yr 17 minutes ago, Scholler said: I don't even know what's static method you need to learn java first before modding and if you dont know something use google most of the time it has a good answer
April 30, 20205 yr So. When I said you needed static, your code looked like this: @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent public void onKb (LivingKnockBackEvent e) { using an annotation. Now it looks like this: MinecraftForge.EVENT_BUS.register(new KnockbackR()); ... public static class KnockbackR { //Tried without static, tried with only the class static. public static void onKb(LivingKnockBackEvent e) { System.out.println("Called"); no, not called } } Why did you change something I didn't tell you to change? Now the fact that your method is static is the problem. (The class being static is basically irrelevant, but it should be static anyway, but that's not the method its the class). You HAVE THIS for godsake. @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent a normal void WHICH STILL WORKING } Although it appears you couldn't be arsed to show the method signature of a working event, because you also have this for some reason: MinecraftForge.EVENT_BUS.register(new RegistryEvents()); So who knows which one of the two registrations is working for the handlers that are working correctly. Edited April 30, 20205 yr by Draco18s 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.
May 1, 20205 yr Author 12 hours ago, loordgek said: you need to learn java first before modding and if you dont know something use google most of the time it has a good answer lmao. 13 hours ago, Scholler said: you should help, not insult me or think that I'm so stupid I don't even know what's static method I see you dont get it
May 1, 20205 yr Author 12 hours ago, Draco18s said: So. When I said you needed static, your code looked like this: @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent public void onKb (LivingKnockBackEvent e) { using an annotation. Now it looks like this: MinecraftForge.EVENT_BUS.register(new KnockbackR()); ... public static class KnockbackR { //Tried without static, tried with only the class static. public static void onKb(LivingKnockBackEvent e) { System.out.println("Called"); no, not called } } Why did you change something I didn't tell you to change? Now the fact that your method is static is the problem. (The class being static is basically irrelevant, but it should be static anyway, but that's not the method its the class). You HAVE THIS for godsake. @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent a normal void WHICH STILL WORKING } Although it appears you couldn't be arsed to show the method signature of a working event, because you also have this for some reason: MinecraftForge.EVENT_BUS.register(new RegistryEvents()); So who knows which one of the two registrations is working for the handlers that are working correctly. 12 hours ago, Draco18s said: So. When I said you needed static, your code looked like this: @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent public void onKb (LivingKnockBackEvent e) { using an annotation. Now it looks like this: MinecraftForge.EVENT_BUS.register(new KnockbackR()); ... public static class KnockbackR { //Tried without static, tried with only the class static. public static void onKb(LivingKnockBackEvent e) { System.out.println("Called"); no, not called } } Why did you change something I didn't tell you to change? Now the fact that your method is static is the problem. (The class being static is basically irrelevant, but it should be static anyway, but that's not the method its the class). You HAVE THIS for godsake. @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @SubscribeEvent a normal void WHICH STILL WORKING } Although it appears you couldn't be arsed to show the method signature of a working event, because you also have this for some reason: MinecraftForge.EVENT_BUS.register(new RegistryEvents()); So who knows which one of the two registrations is working for the handlers that are working correctly. OK. Gonna test.
May 1, 20205 yr 1 hour ago, Scholler said: you should help, not insult me or think that I'm so stupid I don't even know what's static method i am not insulting you or call you stupid i am just telling you to learn java, it will help you in the long run everybody here needed to learn at some point
May 1, 20205 yr 3 hours ago, Scholler said: lmao. I see you dont get it Quote Modder Support This is the support section for those modding with Forge. Help with modding goes in here, however, please keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here. 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.
May 2, 20205 yr Author no I have never said I don't even know what a static method is I said you shouldn't think that I don't know what a static method is I see you quote the part where I said what you shouldn't think about me, no problem. I still haven't figured it out, nothing worked, so at this point I'm just kinda searching the internet, and I'm spending less time on coding this mod
May 2, 20205 yr 46 minutes ago, Scholler said: I have never said I don't even know what a static method is Right: On 4/30/2020 at 1:44 PM, Scholler said: Where am I supposed to put ,,static'' ? 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.
May 2, 20205 yr Rule 1 of asking a question: don't get butthurt when someone points out you don't know shit, that's what you're here to supposedly solve. Rule 2, nobody is even obligated to help you, be courteous. Everything in that doc is plenty to solve your issue, registering an event handler, and subscribing to an event is less than 5 lines of code. That doc outlines what to do depending on the functionality you want, in this case Draco thoroughly explained your method must be static. So when you register your event handler, you must pass in an instance of the class, or you can annotate your class.
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.