• Forums

Navigation

  • Home
  • Style Guide
  • Getting Started
    • Home
    • Structuring Your Mod
    • Forge Update Checker
    • Dependency Management
  • Concepts
    • Sides
    • Resources
    • Registries
    • The Fingerprint Violation Event
  • Blocks
    • Home
    • Intro to Blockstates
    • Interaction
  • Tile Entities
    • Special Renderer
  • Items
    • Home
    • Loot Tables
  • Models
    • Intro to Models
    • Model Files
    • Blockstates
      • Intro to Blockstate JSONs
      • Forge Blockstate JSON
    • Connecting Blocks and Items to Models
    • Coloring Textures
    • Item Property Overrides
    • Advanced Models
      • Intro to Advanced Models
      • IModel
      • IModelState and IModelPart
      • IBakedModel
      • Extended Blockstates
      • Perspective
      • ItemOverrideList
      • ICustomModelLoader
  • Rendering
    • TileEntityItemStackRenderer
  • Events
    • Basic Usage
  • Networking
    • Home
    • Overview
    • SimpleImpl
  • Data Storage
    • Capabilities
    • World Saved Data
    • Extended Entity Properties
    • Config Annotations
  • Utilities
    • OreDictionary
  • Effects
    • Sounds
  • Conventions
    • Versioning
    • Locations
    • Loading Stages
      • Pre-Initialization
      • Initialization
      • Post-Initialization
      • Other Important Events
  • Contributing to Forge
    • Getting Started
    • PR Guidlines

Loading Stages

Forge loads your mod in 3 main stages: Pre-Initialization, Initialization, and Post-Initialization, commonly referred to as preInit, init, and postInit. There are some other events that are important too, depending on what your mod does. Each of these stages occurs at a different point in the loading stage and thus what can be safely done in each stage varies.

Note

Loading stage events can only be used in your @Mod class, in methods marked with the @EventHandler annotation.

Important

Many objects that were previously registered in loading stage event handlers (Blocks, Items, Recipes, etc.) should now be registered via RegistryEvents. This is to pave the way to being able to reload mods dynamically at runtime, which can’t be done using loading stages (as they are fired once upon application startup). RegistryEvents are fired after Pre-Initialization.

Pre-Initialization

Pre Init is the place to let the game know about all the blocks, items, etc that your mod provides. This stage’s event is the FMLPreInitializationEvent. Common actions to preform in preInit are:

  • Registering blocks and items to the GameRegistry
  • Registering tile entities
  • Registering entities
  • Assigning ore dictionary names

Initialization

Init is where to accomplish any game related tasks that rely upon the items and blocks set up in preInit. This stage’s event is the FMLInitializationEvent. Common actions to preform in init are:

  • Registering world generators
  • Registering recipes
  • Registering event handlers
  • Sending IMC messages

Post-Initialization

Post Init is where your mod usually does things which rely upon or are relied upon by other mods. This stage’s event is the FMLPostInitializationEvent. Common actions to preform in postInit are:

  • Mod compatibility, or anything which depends on other mods’ init phases being finished.

Other Important Events

  • IMCEvent: Process received IMC Messages
  • FMLServerStartingEvent: Register Commands
Previous Next
Built with MkDocs using a custom theme. Hosted by Read the Docs.
Enable Dark Theme