Complete guide for integrating Essential Loader with Forge 1.8.9-1.12.2
Essential Loader for LaunchWrapper provides Mixin 0.8.x support and Jar-in-Jar dependency management for Minecraft 1.8.9 through 1.12.2 (commonly called “legacy Forge” or “LaunchWrapper”).
Create an embed configuration and add Essential Loader as a dependency:
build.gradle.kts
val embed by configurations.creatingconfigurations.implementation.get().extendsFrom(embed)dependencies { embed("gg.essential:loader-launchwrapper:1.3.2")}
3
Configure Jar Task
Embed Essential Loader into your mod jar and set the TweakClass:
build.gradle.kts
tasks.jar { // Embed the contents of the Essential Loader jar into your mod jar dependsOn(embed) from(embed.files.map { zipTree(it) }) // Set Essential Loader as the Tweaker for your mod manifest.attributes(mapOf( "TweakClass" to "gg.essential.loader.stage0.EssentialSetupTweaker" ))}
If you already have a custom Tweaker, you can have it extend EssentialSetupTweaker instead of replacing it.
If you previously used the Mixin Tweaker, you can simply use Essential Loader instead. It automatically initializes Mixin for any mod with a MixinConfigs attribute.
4
Create essential.mod.json
Create a essential.mod.json file in your src/main/resources folder:
Automate the inclusion of Jar-in-Jar dependencies based on Gradle dependencies:
1
Create JiJ Configuration
build.gradle.kts
val jij by configurations.creatingconfigurations.implementation.get().extendsFrom(jij)dependencies { // Add all the dependencies you wish to jar-in-jar to the custom `jij` configuration jij("com.example:examplelib:0.1.0")}
2
Configure processResources Task
Auto-generate the version and jars entries:
build.gradle.kts
tasks.processResources { val expansions = mapOf( "version" to version, "jars" to provider { jij.resolvedConfiguration.resolvedArtifacts.joinToString(",\n") { artifact -> val id = artifact.moduleVersion.id """ { "id": "${id.group}:${id.name}", "version": "${id.version}", "file": "META-INF/jars/${artifact.file.name}" } """.trimIndent() } }, ) inputs.property("expansions", expansions) filesMatching("essential.mod.json") { expand(expansions) }}
MixinExtras is automatically initialized by Essential Loader:
build.gradle.kts
dependencies { // Essential Loader will automatically initialize MixinExtras // No need to call `MixinExtrasBootstrap` jij(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1")!!) // Or if you've previously used Essential's relocated MixinExtras version: jij(annotationProcessor("gg.essential.lib:mixinextras:0.4.0")!!)}
annotationProcessor is necessary to generate refmaps if your build system does not setup MixinExtras for you.
LaunchWrapper is what Forge 1.8.9 - 1.12.2 are based on. While technically independent from Forge (published by Mojang), stage0 is completely independent from Forge, and stage1 has separate code paths for pure LaunchWrapper vs LaunchWrapper+Forge.
Relaunching is always required on 1.8.9 because the default ASM library is too old for Mixin 0.8.x needs. On 1.12.2, relaunching is used for simplicity and consistency.
Essential Loader uses a “relaunch” mechanism that creates a second, mostly clean, mostly isolated environment within the existing LaunchWrapper environment. This allows using more recent versions of certain libraries that would otherwise not be possible.
If you’re packaging Essential Loader for ModLauncher 9+, you must relocate stage0 to avoid package conflicts. For LaunchWrapper, relocation is optional but recommended.
Chain-loading production mods is trivial on LaunchWrapper: just add them to the classpath and Forge will discover them as usual.