Overview
Stage 1 handles configuration management, automatic updates, and loading Stage 2 (the actual Essential mod or other compatible mods). It provides a stable update mechanism that allows Essential Loader to self-update without requiring mod reinstallation.Core Components
EssentialLoaderBase
Abstract base class providing update checking and Stage 2 loading logic for all platforms. Package:gg.essential.loader.stage1
Platform variant (e.g., “launchwrapper”, “fabric”, “modlauncher”)
Minecraft version (e.g., “1.8.9”, “1.20.1”)
Key Methods
load()
Main entry point that loads and starts Stage 2.Game directory containing Essential data and configuration
-
Configuration Loading
- Reads
essential-loader-stage2.propertiesfrom classpath - Loads pinned version metadata if present
- Reads user configuration from data directory
- Merges environment variables and system properties
- Reads
-
Version Resolution
- Checks local Stage 2 file and validates checksum
- Fetches latest online version metadata if needed
- Applies pinned version constraints
- Handles update prompts based on auto-update mode
-
Stage 2 Loading
- Downloads or updates Stage 2 JAR if required
- Adds Stage 2 to platform class loader
- Instantiates
gg.essential.loader.stage2.EssentialLoader - Calls
load()method on Stage 2 instance
initialize()
Calls theinitialize() method on the loaded Stage 2 instance.
load() completes, typically at a later stage of the game loading process.
getStage2()
Returns the loaded Stage 2 instance for platform-specific access.The Stage 2 loader instance (type varies by platform), or
null if not loadedaddToClassLoader()
Platform-specific method to add Stage 2 JAR to the appropriate class loader.URL to the Stage 2 JAR file
The class loader that now contains Stage 2 classes
Configuration System
Configuration Properties
essential-loader-stage2.properties (Embedded)
Embedded in container JARs to specify pinned versions.Path to pinned Stage 2 JAR (resource path starting with
/ or URL)MD5 checksum of pinned JAR for validation
Version string of pinned JAR for comparison
Default update branch (e.g., “stable”, “beta”)
stage2..properties (User Config)
User-modifiable configuration in the data directory.Auto-update mode:
true: Automatic updates (default)with-prompt: Manual updates with user consentfalse: No automatic updates
User’s preferred update branch
Version override for pinned versions (manual update mode)
Version awaiting user approval (manual update mode)
User’s decision on pending update:
true, false, or unsetEnvironment Variables
Base URL for Essential API endpoints
Default update branch (overrides embedded config)
System Properties
Base URL for Essential API (overrides environment variable)
Update branch (overrides all other sources)
Auto-update mode (overrides file configuration)
Set to
true when game has been relaunched (internal)Update System
Auto-Update Modes
Full
Default ModeAutomatically checks for and installs updates without user interaction.
Manual
With PromptChecks for updates and prompts user before installation. Used when pinned versions are present.
Off
DisabledNo network communication beyond initial download.
Update Flow
API Endpoints
Stage 1 communicates with Essential’s API for version metadata and downloads./v1/essential:loader-stage2/versions/{branch}/platforms/{gameVersion}
Fetch latest Stage 2 version metadataResponse:
/v1/essential:loader-stage2/versions/{version}/platforms/{gameVersion}/download
Fetch download URL for specific versionResponse:
/v1/essential:loader-stage2/versions/{version}/changelog
Fetch changelog for update promptResponse:
Version Comparison
VersionComparison Utility
Compares semantic versions for update decisions.First version string (e.g., “1.2.3”)
Second version string (e.g., “1.2.4”)
- Negative if v1 < v2
- Zero if v1 = v2
- Positive if v1 > v2
Update Prompt UI
ForkedUpdatePromptUI
Displays update prompt in a separate JVM process to avoid class loading conflicts.- Runs in isolated JVM to avoid Swing/AWT conflicts
- Shows changelog and version information
- Returns
true(accept),false(decline), ornull(closed)
Pinned Versions
Use Case
Mods can pin specific Stage 2 versions to ensure compatibility.Behavior
- Pinned version takes precedence over existing local versions
- Auto-update mode changes to
Manualwhen pinned version detected - User can override pinned version with
overridePinnedVersionconfig - Downgrade support by shipping older container JAR with lower pinned version
Error Handling
Common Scenarios
Download failure
Download failure
Error: “Unable to download Essential, please check your internet connection”Causes:
- Network connectivity issues
- API endpoint unavailable
- Firewall blocking requests
Checksum mismatch
Checksum mismatch
Error: “Downloaded Essential file checksum did not match”Causes:
- Corrupted download
- Network proxy interference
- CDN cache inconsistency
Version not supported
Version not supported
Warning: “Essential does not support the following game version”Causes:
- Minecraft version too new or too old
- API returns null for version
Platform Implementations
LaunchWrapper
Class:gg.essential.loader.stage1.EssentialSetupTweaker
Fabric
Class:gg.essential.loader.stage1.EssentialSetupPreLaunch
ModLauncher
Class:gg.essential.loader.stage1.EssentialTransformationService
Integration Testing
Test Properties
See Also
- Stage 0 API - Bootstrap and Stage 1 discovery
- Stage 2 API - Chain-loading and Essential mod installation
- Quickstart - Getting started with Essential Loader