Events/Launch/minified-launch

InstallNeoforgeEvent

Fired continuously while NeoForge is installing

Fields

Current installation phase of the NeoForge installer process

Accessor: stage()
gameVersionString

Target Minecraft version (e.g., 1.20.1)

Accessor: gameVersion()
loaderVersionString

NeoForge loader version being installed

Accessor: loaderVersion()

Types

InstallNeoforgeEvent.Stage

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

When it fires

NeoInstallerInjector mirrors ForgeInstallerInjector almost exactly and fires from Launcher.launchMinecraft(...) whenever LaunchConfiguration.loader is a NeoforgeLoader and the launch is online. The stage order is the same as InstallForgeEvent, minus EXTRACTING (which NeoForge's Stage enum doesn't even define):

  1. PREPARING: always first.
  2. WRITING_PROFILE: only if launcher_profiles.json doesn't already exist; skipped on repeat launches.
  3. DOWNLOADING_INSTALLER: before resolving the NeoForge version and downloading its installer JAR.
  4. RUNNING_INSTALLER: before invoking the NeoForge installer via reflection.
  5. FINISHED or FAILED, exactly one of these fires last, mirroring Forge's behavior.

Unlike Forge, NeoForge's installer is invoked with a Predicate<String> for "optional" components that always returns true, so all optional install steps are accepted automatically - there's no event for that decision either.

Listening

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

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

Posted by

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