Posted October 28, 20169 yr Hello Guys, im new at this Forum and my Englishskills are not the best - I´ll try my best Yesterday I started coding with Forge a new Mod, I´ve coded 2 mods already. Ok, I wanted do put in my EventHandler a new Event called onRenderTick, because i wanna draw a String Ingame. in the head of the function I wrote TickEvent.RenderTickEvent e so there is a little test, wie a simple System.out.Println: @SubscribeEvent public void onRenderTick(TickEvent.RenderTickEvent e){ System.out.println("the RenderTickevent fired"); } Of course did I register the Event in my MainClass @EventHandler public void init(FMLInitializationEvent e) { MinecraftForge.EVENT_BUS.register(new tk.camperboyz.campermod.event.EventHandler()); } If I would start Minecraft now, there is no Textoutput in the console. I´ve did everything that I know what to do in this situation. Does someone know what I did wrong, would be very helpful. Thanks. Jonnyb170 Edit: I use Forge 1.8.9
October 29, 20169 yr try using FMLCommonHandler.instance().bus().register(new FMLEventPlayerTick()); to register that event, it's a FML event some more context would be: public static void registerEvents() { FMLCommonHandler.instance().bus().register(new FMLEventPlayerTick()); MinecraftForge.EVENT_BUS.register(new EventEntityConstruction()); //MinecraftForge.EVENT_BUS.register(new EventEntityLivingUpdate()); } the above method is being called in the postInit (in my case) not sure if it would do better being in the preInit but seems to still work. oh the FML event I have there is: @SubscribeEvent public void playerTickEvent(TickEvent.PlayerTickEvent event) Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
October 29, 20169 yr Ah very nice, Thought I still had to use the FMLCommonHandler for those type of events. But if Jonnyb170 wishes to continue with 1.8.9 he'll have to use the outdated advice. Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
October 29, 20169 yr Ah very nice, Thought I still had to use the FMLCommonHandler for those type of events. But if Jonnyb170 wishes to continue with 1.8.9 he'll have to use the outdated advice. (I think the Hint to take here is to not make or update current outdated versions. people need to move on and code for the latest versions. people coding for older versions is why the modding community, (mostly the end users), has problems moving on.) https://minecraft.curseforge.com/members/Subaraki/projects
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.