Jump to content

Forgotten how to register Events correctly o.O


Busti

Recommended Posts

Hi,

After 5 Months of not Modding it seems like I have forgotten how to register Events correctly -.-

This goes in the base class?

    @Mod.EventHandler
    public void init(FMLInitializationEvent event) {
        MinecraftForge.EVENT_BUS.register(new CTEvent());
    }

And this is the Event Class right?

package com.mlb.vrc.event;

import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;

public class CTEvent{
    @SubscribeEvent
    public void ClientTickEvent(TickEvent event) {
        System.out.println("Whatever");
    }


}

 

Thanks

- Busti

 

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

Hi,

After 5 Months of not Modding it seems like I have forgotten how to register Events correctly -.-

This goes in the base class?

    @Mod.EventHandler
    public void init(FMLInitializationEvent event) {
        MinecraftForge.EVENT_BUS.register(new CTEvent());
    }

And this is the Event Class right?

package com.mlb.vrc.event;

import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;

public class CTEvent{
    @SubscribeEvent
    public void ClientTickEvent(TickEvent event) {
        System.out.println("Whatever");
    }


}

 

Thanks

- Busti

 

Yep. And fml events are registered here FMLCommonHandler.instance().bus()...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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