Forge is comprised of a couple of main components
- FML – forge mod loader – which is mostly concerned with loading mods and initialising them, but also provides most of the Registries.
- Minecraftforge – adds a large number of extra events and hooks
They were developed independently and are stored in different packages (cpw.mods.fml vs net.minecraftforge), but apart from that you’ll use them in the same way. The biggest symptom you might notice is that the paradigms are sometimes a bit inconsistent – naming conventions, hook methods, event handlers, commenting style – but nothing too hard to get used to.
Often it is difficult to know exactly which forge methods or hooks are going to be useful to create the behaviour you want. A general strategy I have found effective is:
- Think of a part of the vanilla minecraft which does something similar to what you want to do.
- Open up that item, block, entity (or whatever) and browse through the vanilla code to see how it works.
- Look for ways to divert the program flow to your own code:
* Methods that you can override in your own classes (especially for Blocks, Items, Entities)
* A forge event or hook inserted into the vanilla code, which you can register for.
~Overview of Forge (and what it can do for you)
Some general notes
How Forge starts up your code (@Mod, @SidedProxy, etc)
Registering your classes
Extra methods for vanilla base classes
Forge summary - grouped by task
World generation, loading, saving
Miscellaneous - player input, rendering, GUI, chat, sounds