Jump to content

Cannot subscribe for events


Aeliios

Recommended Posts

Hello, It's my first mod and I'm struggling to subscribe at certain events (only cpw.mods.fml.common.gameevent ?), maybe I didn't understand something.

So in my main mod class, in FMLPreInitializationEvent  

MinecraftForge.EVENT_BUS.register(new EventsHandler());

In my EventsHandler class :

public class EventsHandler {

	@SubscribeEvent
	public void onItemPickup(ItemPickupEvent e) {
		FirstMod.instance.logger.log(Level.INFO, "test pickup");
	}
	
	@SubscribeEvent
	public void onItemPickup2(EntityItemPickupEvent e) {
		FirstMod.instance.logger.log(Level.INFO, "test pickup2");
	}
}

 

On an item pickup i successfully get the "test pickup2" message, but not the first one from the ItemPickupEvent.

I tested others events and it seems like it doesn't work with all fml game events.

Thanks in advance.

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.