Overview
Essential uses a three-stage loader architecture to enable seamless in-game updates, version management, and cross-platform compatibility without requiring users to manually update mod files.The loader is split into three stages, each with one JAR per platform. For platform details, see the Platforms documentation.
Why Three Stages?
A multi-stage loader solves several critical challenges:In-Game Updates
Users receive updates automatically without replacing mod files.
Version Isolation
Different Minecraft versions can use different Essential versions without conflicts.
Classloader Separation
Prevents version conflicts and enables hot-swapping of code.
Minimal Footprint
Container mods are tiny (< 1MB) since they download the actual mod on demand.
Stage 0: Initial Bootstrap
Purpose
Stage 0 is the entry point that Minecraft’s mod loader executes. It’s embedded in both container mods and pinned JARs.Responsibilities
Detect environment
Identify the Minecraft version, mod loader type (Forge/Fabric/NeoForge), and platform variant.
Extract Stage 1
Extract the Stage 1 loader from either:
- The container mod JAR (for container mods)
- The bundled Essential JAR (for pinned mods)
File Location
Stage 0 files
Stage 0 code example
Stage 0 code example
Simplified Stage 0 entry point
Stage 1: Version Management
Purpose
Stage 1 manages Essential versions and prepares the environment for loading the actual mod.Responsibilities
Update check
For container mods, check Essential’s servers for the latest version and download if needed.
File Location
Stage 1 files
Stage 1 is extracted from whichever source has the most recent version (container mod or pinned JAR).
Update Flow
- Container Mod
- Pinned Mod
Container mods always check for the latest Essential version on startup.
Version Isolation
Stage 1 ensures different Minecraft versions can use different Essential versions:Essential version storage
Stage 2: Mod Loading
Purpose
Stage 2 is the actual Essential Mod implementation. It loads dependencies and initializes Essential’s features.Responsibilities
Extract libraries
Extract bundled dependencies from
META-INF/jars/ to .minecraft/essential/libraries/.File Location
Stage 2 files
Library Management
Stage 2 handles Essential’s dependencies:Dependency structure
Why extract libraries?
Why extract libraries?
Extracting libraries has several benefits:
- Shared across versions: Multiple Essential versions can share the same library files
- Faster startup: No need to extract every launch
- Smaller downloads: Updates only need to include changed libraries
- Classloader flexibility: Libraries can be loaded in specific classloaders as needed
Stage Interaction Diagram
Container vs Pinned Mods
The loader stages enable two different distribution models:- Container Mod
- Pinned Mod
Container Mod (essential.gg/download)
A minimal JAR that downloads Essential on first launch.Structure:- Downloads latest Essential on first launch
- Automatically updates to new versions
- Minimal file size
- Four variants (one per platform)
- Essential Installer
- essential.gg/download
- Mods that embed Essential Loader
Classloader Hierarchy
Each stage uses an isolated classloader to prevent version conflicts:This isolation allows Stage 1 to be updated independently of Stage 2, and both can be updated without affecting the container mod in the mods folder.
File Locations Reference
.minecraft/mods/ folder
.minecraft/mods/ folder
Container mods (< 1MB):
essential-fabric.jaressential-forge-1.12.2.jaressential-forge-1.16.5.jaressential-forge-1.20.4.jar
pinned_Essential (fabric_1.20.4).jarpinned_Essential (forge_1.12.2).jar
.minecraft/essential/ folder
.minecraft/essential/ folder
Main Essential JARs:
Essential (fabric_1.20.4).jarEssential (fabric_1.20.4).processed.jar(temporary)Essential (forge_1.12.2).jar
libraries/*.jar
.minecraft/essential/loader/ folder
.minecraft/essential/loader/ folder
Stage files:
stage1.jar(extracted from container/pinned mod)stage2.fabric_1.20.4.jarstage2.fabric_1.20.4.jar.meta(version info)
Building the Loader
Building All Stages
The loader is automatically built when building Essential:loader/<stage>/<platform>/build/libs/.
Building Specific Stages
Building individual stages
The loader is maintained in a separate Git submodule at
loader/. Run git submodule update --init --recursive after cloning.Verifying Loader Files
To verify the authenticity of loader files:Build from source or download checksums
Either build the loader yourself or download checksums from GitHub Actions.
Advanced Topics
Loader stage versioning
Loader stage versioning
Each stage has its own version number:
- Stage 0: Embedded in container/pinned mods, updated with Essential releases
- Stage 1: Extracted from the latest source (container or pinned mod)
- Stage 2: Has independent versioning, stored with
.metafiles
.meta file contains Stage 2’s version:.minecraft/essential/loader/stage2.fabric_1.20.4.jar.meta
Processed JARs
Processed JARs
Files ending in
.processed.jar are temporary transformations of the main Essential JAR:- Created by Stage 2 for compatibility
- Safe to delete (regenerated on next launch)
- Contain the same code with minor modifications
Hot-swapping and updates
Hot-swapping and updates
The multi-stage architecture theoretically allows hot-swapping Essential without restarting Minecraft:
- Stage 1 downloads a new Essential version
- Unloads the current Stage 2 classloader
- Extracts and loads the new Stage 2
- Re-initializes Essential features
Next Steps
Platform Support
Learn about the four loader platforms Essential supports
Building Container
Build Essential Container mods from source
Building Loader
Build the Essential Loader stages
Architecture
Return to the architecture overview