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.

Featured Replies

Posted

Hello Guys, im new at this Forum and my Englishskills are not the best - I´ll try my best :D

 

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

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)

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.)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.