coolboy4531 Posted January 10, 2014 Share Posted January 10, 2014 is there an event list for forge on 1.7.2? I can only find outdated ones, and I'm not the type of person who has toooooooooo much information about Forge. Quote Link to comment Share on other sites More sharing options...
Naah Posted January 10, 2014 Share Posted January 10, 2014 In this same vein, seeing some sample/tutorial code specifically pertaining to 1.7.2 would be awesome for us noobs. Although I am slowly patching things together. Quote Link to comment Share on other sites More sharing options...
roflmuffin Posted January 10, 2014 Share Posted January 10, 2014 You can just type Event. and wait for your IDE to autofill with Events, they are all pretty self explanatory. You can also download the Javadoc. The ones below are taken directly from the Javadocs. InputEvent.KeyInputEvent InputEvent.MouseInputEvent PlayerEvent.ItemCraftedEvent PlayerEvent.ItemPickupEvent PlayerEvent.ItemSmeltedEvent PlayerEvent.PlayerChangedDimensionEvent PlayerEvent.PlayerLoggedInEvent PlayerEvent.PlayerLoggedOutEvent PlayerEvent.PlayerRespawnEvent TickEvent.ClientTickEvent TickEvent.PlayerTickEvent TickEvent.RenderTickEvent TickEvent.ServerTickEvent TickEvent.WorldTickEvent As for some sample code... @EventHandler public void preInit(FMLPreInitializationEvent event) { FMLCommonHandler.instance().bus().register(new ExampleEvent()); } public class TestEvent { @SubscribeEvent public void onItemPickup(PlayerEvent.ItemPickupEvent event) { System.out.println("You just picked up: " + event.pickedUp.toString()); } } Quote Link to comment Share on other sites More sharing options...
mrgreaper Posted January 10, 2014 Share Posted January 10, 2014 You can just type Event. and wait for your IDE to autofill with Events, they are all pretty self explanatory. You can also download the Javadoc. The ones below are taken directly from the Javadocs. InputEvent.KeyInputEvent InputEvent.MouseInputEvent PlayerEvent.ItemCraftedEvent PlayerEvent.ItemPickupEvent PlayerEvent.ItemSmeltedEvent PlayerEvent.PlayerChangedDimensionEvent PlayerEvent.PlayerLoggedInEvent PlayerEvent.PlayerLoggedOutEvent PlayerEvent.PlayerRespawnEvent TickEvent.ClientTickEvent TickEvent.PlayerTickEvent TickEvent.RenderTickEvent TickEvent.ServerTickEvent TickEvent.WorldTickEvent As for some sample code... @EventHandler public void preInit(FMLPreInitializationEvent event) { FMLCommonHandler.instance().bus().register(new ExampleEvent()); } public class TestEvent { @SubscribeEvent public void onItemPickup(PlayerEvent.ItemPickupEvent event) { System.out.println("You just picked up: " + event.pickedUp.toString()); } } i thought there was more events then that Quote Link to comment Share on other sites More sharing options...
general3214 Posted January 10, 2014 Share Posted January 10, 2014 There are lots of them: https://github.com/MinecraftForge/MinecraftForge/tree/master/src/main/java/net/minecraftforge/event Explore Forge source code more often. Quote Before you even think about modding, please learn basic Java. Link to comment Share on other sites More sharing options...
roflmuffin Posted January 11, 2014 Share Posted January 11, 2014 It should be noted that events derived from net.minecraftforge must be registered using: MinecraftForge.EVENT_BUS.register(new CustomEvent()); Whereas events derived from cpw.mods.fml.common.gameevent must be registered using: FMLCommonHandler.instance().bus().register(new CustomEvent()); Quote Link to comment Share on other sites More sharing options...
Kukipett Posted February 4, 2014 Share Posted February 4, 2014 I noticed that the PlayerEvent.PlayerLoggedOutEvent is not called when you quit the game, i tested it in both single and multiplayer. But PlayerEvent.PlayerRespawnEvent works actually Is there another event to use when you logout and quit the game to save config and such... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.