Class ModLoader

java.lang.Object
net.minecraftforge.fml.ModLoader

public class ModLoader extends Object
Loads mods. Dispatch cycle is seen in #loadMods() and #finishMods() Overall sequence for loadMods is:
CONSTRUCT
Constructs the mod instance. Mods can typically setup basic environment such as Event listeners and Configuration specifications here.
Automated dispatches
Dispatches automated elements : net.minecraftforge.fml.common.Mod.EventBusSubscriber, net.minecraftforge.event.RegistryEvent, net.minecraftforge.common.capabilities.CapabilityInject and others
CONFIG_LOAD
Dispatches ConfigLoadEvent to mods
COMMON_SETUP
Dispatches net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent to mods
SIDED_SETUP
Dispatches net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent or net.minecraftforge.fml.event.lifecycle.FMLDedicatedServerSetupEvent to mods
Overall sequence for finishMods is:
ENQUEUE_IMC
Dispatches net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent to mods, for enqueuing InterModComms messages for other mods to receive subsequently
PROCESS_IMC
Dispatches net.minecraftforge.fml.event.lifecycle.InterModProcessEvent to mods, for processing InterModComms messages received from other mods prior to this event
COMPLETE
Dispatches net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent to mods, and completes the mod loading sequence.
  • Field Details

    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • INSTANCE

      private static ModLoader INSTANCE
    • loadingModList

      private final LoadingModList loadingModList
    • loadingExceptions

      private final List<ModLoadingException> loadingExceptions
    • loadingWarnings

      private final List<ModLoadingWarning> loadingWarnings
    • stateManager

      private final ModStateManager stateManager
    • loadingStateValid

      private boolean loadingStateValid
    • statusConsumer

      private final Optional<Consumer<String>> statusConsumer
    • modList

      private ModList modList
    • runningDataGen

      private static boolean runningDataGen
  • Constructor Details

    • ModLoader

      private ModLoader()
  • Method Details