Events/Launch/minified-launch

InstallForgeEvent

Fired continuously while Minecraft Forge is installing

Fields

Current installation phase of the Forge installer process

Accessor: stage()
gameVersionString

Target Minecraft version (e.g., 1.20.1)

Accessor: gameVersion()
loaderVersionString

Forge loader version being installed (e.g., 47.2.0)

Accessor: loaderVersion()

Types

InstallForgeEvent.Stage

API
PREPARINGInitial environment checks and directory setup
DOWNLOADING_INSTALLERFetching required installer binaries
EXTRACTINGUnpacking Forge libraries into the target directory
RUNNING_INSTALLERExecuting the Forge installer process
WRITING_PROFILEUpdating the client launcher profile configuration
FINISHEDInstallation completed successfully
FAILEDInstallation encountered an error or was aborted

When it fires

ForgeInstallerInjector runs from Launcher.launchMinecraft(...) whenever LaunchConfiguration.loader is a ForgeLoader and the connectivity check earlier in the launch succeeded (Forge is never installed in offline mode - the launch just proceeds assuming Forge is already installed from a previous run). The stages fire in this order:

  1. PREPARING: always first; creates the versions/libraries directories.
  2. WRITING_PROFILE: only if launcher_profiles.json doesn't already exist in the game directory. On repeat launches where it's already there, this stage is skipped entirely.
  3. DOWNLOADING_INSTALLER: before fetching the Forge installer JAR and verifying its SHA-1.
  4. RUNNING_INSTALLER: before invoking the official Forge installer via reflection to do the actual client install.
  5. Either FINISHED (install succeeded) or FAILED (a reflective invocation error occurred, followed by a thrown RuntimeException). Exactly one of these always fires last.

Listening

Subscribe on the EventBus the event is posted to, see Events for which bus that is.

eventBus.subscribe(InstallForgeEvent.class, event -> {
    Stage stage = event.stage();
    String gameVersion = event.gameVersion();
    String loaderVersion = event.loaderVersion();
});

Posted by

API reference: com.dervarex.minified.launch.events.loader.InstallForgeEvent