Wiki 9Minecraft Wiki 9Minecraft

Intervene in Mod Loader Setup Before Initialization

Java EditionModGuides 4FAQ 10Related mods 60
DownloadPreloading Tricks Mod

Get the files on 9Minecraft

Contents (4)
  1. Understand the Preloading Phase
  2. Register an Early Callback
  3. Perform Setup Tasks
  4. Verify Execution Order

Understand the Preloading Phase

Preloading Tricks lets you hook into the mod loader's setup process before it officially initializes mods. This phase is ideal for global configuration changes or environment preparation that must happen before any mod code runs.

Register an Early Callback

Set up a callback that responds to loader events like onSetupLanguageAdapter or onSetupMods. Your code will execute during the loader's internal setup, not during standard mod initialization.

Perform Setup Tasks

Use your early callback to:

  • Modify how language adapters are configured
  • Adjust the mod discovery or loading order
  • Inject data or configuration the loader needs
  • Prepare the environment for mods that depend on special conditions

Verify Execution Order

Because these hooks run so early, they execute before mod constructors, @Mod.EventHandler methods, and common setup events. This makes them powerful for foundational changes but requires careful coordination if multiple mods use preloading tricks.

More guides for this mod