Installing Modpacks
Eranio
Installing Modpacks
Complete guide to the 8-step installation process, egg switching, backup creation, file preservation, config merging, direct install, and all possible errors.
Before You Install
Installation Type Detection
The plugin looks up the pack stored for the server in the table server_installed_modpacks to determine the installation type:
| Type | Condition | What Happens |
|---|---|---|
| Fresh | No pack stored for the server | Clean install, minimal cleanup |
| Update | Same modpack, different version | Choice: keep or delete configs |
| Change | Different modpack ID | Full cleanup + fresh install |
| Reinstall | Same modpack + same version | Reinstall current version |
The 8-Step Installation Process
Step 1: Preserve
Important files are saved to memory before any deletion:
Root files preserved:
server.propertieseula.txtops.jsonbanned-players.jsonbanned-ips.jsonwhitelist.jsonusercache.json
Directories preserved (recursive):
/config/, Mod configuration files/plugins/, Plugin JARs and configs
Log: "[Modpack] Files preserved successfully"
Step 2: Backup
An automatic backup is created with a German-language name based on the installation type:
| Type | Example Backup Name |
|---|---|
| Fresh | "Modpack-Erstinstallation" |
| Update | "Modpack-Update" |
| Change | "Modpack-Wechsel" |
| Reinstall | "Modpack-Neuinstallation" |
- Backup count is managed, oldest deleted when limit reached
- Log: "[Modpack] Backup created" with backup name and server UUID
- On failure: Log error "[Modpack] Failed to create backup", installation continues
Step 3: Delete
All server files are deleted except protected directories:
Protected (never deleted):
worlds, World dataplugins, Plugin directorylogs, Server logs
Log: "[Modpack] Files deleted successfully" On failure: Log error "[Modpack] Failed to delete server files"
Step 4: Download (⬇)
- Server is killed (stopped forcefully)
- Egg switched to "Minecraft Modpack Installer"
- Variables set:
MODPACK_PROVIDER,MODPACK_ID,MODPACK_VERSION_ID - Server reinstalled, triggers the download
- Wait for download, max 300 seconds timeout
Log: "[Modpack] Switched to installer egg" Timeout warning: "[Modpack] Download timeout" with elapsed and max_wait
Step 5: Extract
After download completes, extraction is monitored:
- File stability monitoring: Checks file sizes repeatedly
- 3 consecutive stable checks = decompression complete
- Dynamic timeout based on file stability
Log/timeout: "[Modpack] Decompression timeout" if stability never reached
Step 6: Restore
Preserved files are restored to the server:
- Root files restored to their original locations
/config/and/plugins/conditionally restored:- If Update (keep configs): Skip /config/ and /plugins/ (they'll be merged in Step 7)
- If Change/Fresh/Update (delete): Restore everything
Log on failure: "[Modpack] Failed to restore important files"
Step 7: Merge
Config files are intelligently merged, preserving your custom values while incorporating new structure:
Wait: Up to 45 seconds for mods/ and config/ directories to appear after extraction.
Config Merge Strategies
| Format | Extensions | Strategy |
|---|---|---|
| JSON | .json |
Recursive merge: new structure + old values |
| YAML | .yml, .yaml |
Key-level merge preserving comments |
| Properties | .properties, .cfg |
Key=value merge |
| TOML | .toml |
Section-based merge with header/comment preservation |
Log success: "[Modpack] Config file merged successfully" with file, old_size, merged_size Log warning: "[Modpack] Could not merge config file" with file and error
Plugin Config Merging
After root config merge, the plugin also merges /plugins/PluginName/ subdirectories:
- Scans each plugin's config directory
- Merges individual config files using the same format strategies
- Skips files where old or new content is empty
- Log: "[Modpack] Plugin config file merged successfully"
Step 8: Finalize
- Minecraft version checked: taken from the install record, read from the files if the provider did not report it
- Egg switched back to "Minecraft Modpack Runtime" with the matching Java image and start command
- Pack saved in
server_installed_modpackswith Minecraft and Java version - Install record closed with status
done
Log: "[Modpack] Switched to runtime egg" Log: "[Modpack] Installation completed successfully" with server UUID and elapsed time
Java and Start Command
The pack decides which Java version the server needs. The plugin finds that out on its own:
- At the start of the install it asks the provider which Minecraft version the chosen pack version is built for. Modrinth reports
game_versions, CurseForgegameVersions(or the version in the file name when that list is empty). - For ATLauncher, FeedTheBeast, Technic and VoidsWrath the version is read from the installed files after the download:
modrinth.index.json,manifest.json,libraries/net/minecraft/serverorversions. - At the end the runtime egg gets the matching Docker image and start command.
| Minecraft | Java |
|---|---|
| 26.x and newer | 25 |
| 1.20.5 to 1.21.x | 21 |
| 1.18 to 1.20.4 | 17 |
| 1.17 | 16 |
| older | 8 |
If no version can be found, Java 21 is used.
Start command
Every modpack server starts with Aikar's G1 flags. The command reads the memory limit of the server each time it starts:
| Memory setting | Heap |
|---|---|
| Limited | Limit minus 10 %, at least 512 MB stay free for Java itself, so Docker does not stop the server |
| Above 12 GB of heap | Same, with the G1 settings for large heaps (region size 16 MB) |
| Unlimited (0) | Starts at 1 GB and may grow to half of the host memory |
Forge and NeoForge packs from 1.17 on start through unix_args.txt, all others through server.jar. Java 8 packs use the same flags without argument files.
Install record
Every install is written to the table server_modpack_installs the moment it starts: provider, pack, version, Minecraft version, where the version came from, Java version, image and status (running, done, failed, aborted). The installer reads this record during the install and at the end. When the install is done, Minecraft and Java version are also stored with the installed pack in server_installed_modpacks.
Installation Actions Matrix
| Action | Fresh | Update (delete) | Update (keep) | Change |
|---|---|---|---|---|
| Create backup | ||||
| Delete mods | - | |||
| Delete configs | - | - | ||
| Merge mod configs | - | - | - | |
| Restore important files | - |
Cross-Plugin Cleanup
When a modpack is installed or changed, the plugin automatically cleans up data from other plugins:
Game Mods Cleanup
- Dynamically resolves
Eranio\GameMods\Services\SafeCacheServiceandCacheKeyService - Clears
server_installed_modstable for the server - Flushes Game Mods cache
- Log: "Cleaned database mods for server {uuid}"
- Warning if class not found: "GameMods classes not found. Skipping cache cleanup."
Minecraft Plugins Cleanup
- Dynamically resolves
Eranio\MinecraftPlugins\Services\SafeCacheServiceandCacheKeyService - Clears
minecraft_installed_pluginstable for the server - Flushes Minecraft Plugins cache
- Log: "Cleaned database plugins for server {uuid}"
- Warning if class not found: "MinecraftPlugins classes not found. Skipping cache cleanup."
Table Not Found Handling
If a table doesn't exist (plugin not installed): "Table '{table}' does not exist. Skipping cleanup."
Post-Response Execution
The installation runs after the HTTP response via app()->terminating() callback. This prevents Livewire serialization errors and allows the progress widget to display immediately.
Progress Widget
During installation, a custom progress widget shows all 8 steps:
| Feature | Detail |
|---|---|
| Poll interval | 2 seconds |
| Step indicators | Arrow-shaped with clip-path CSS |
| Mobile responsive | Custom CSS for mobile visibility |
| Auto-redirect | Uses <img onerror> hack to trigger JavaScript redirect when complete |
| Session tracking | Delete step tracked in session to prevent double reload |
| Cache | Progress stored in cache with 10-minute TTL |
Translation Keys for Steps
| Step | Key |
|---|---|
| 1 | modpacks.ui.steps.preserve |
| 2 | modpacks.ui.steps.backup |
| 3 | modpacks.ui.steps.delete |
| 4 | modpacks.ui.steps.download |
| 5 | modpacks.ui.steps.extract |
| 6 | modpacks.ui.steps.restore |
| 7 | modpacks.ui.steps.merge |
| 8 | modpacks.ui.steps.finalize |
Complete Error Reference
Installation Start
| Notification | Cause |
|---|---|
| "Modpack installation started" | Success, installation beginning in background |
| "Modpack installation failed" | Could not start, check logs |
Backup Errors
| Log | Cause | Impact |
|---|---|---|
| "[Modpack] Failed to create backup" | Disk full, permissions, daemon error | Installation continues without backup |
Download Errors
| Log | Cause | Solution |
|---|---|---|
| "[Modpack] Download timeout" | 300s exceeded | Increase timeout, check server network, try smaller modpack |
| Egg switch failed | Installer egg missing | Check egg seeder ran successfully |
Extraction Errors
| Log | Cause | Solution |
|---|---|---|
| "[Modpack] Decompression timeout" | File stability never reached | Disk full, corrupted download, very large modpack |
Restore Errors
| Log | Cause | Solution |
|---|---|---|
| "[Modpack] Failed to restore important files" | File write failure | Check daemon permissions, disk space |
Merge Errors
| Log | Cause | Solution |
|---|---|---|
| "[Modpack] Could not merge config file" | Invalid format, parse error | Check config file syntax, merge manually |
| "[Modpack] Could not merge plugin config" | Plugin config corrupted | Delete and let plugin regenerate |
| Config dirs don't appear within 45s | Extraction incomplete | Check Step 5 completed, disk space |
Cross-Plugin Cleanup Errors
| Log | Cause | Impact |
|---|---|---|
| "Failed to clean database plugins or cache" | Plugin table missing or db error | Non-critical, old data may remain |
| "Failed to clean database mods or cache" | Game Mods not installed | Non-critical |
File Operation Errors
moveFileOrDirectory(), tries 5 rename methods with fallbackswriteFileToRepository(), tries 3 signature attempts for daemon compatibilityreadFileFromDaemon(), primary method + API fallback