mc-image-helper is a comprehensive tool bundled with the itzg/minecraft-server image that provides complex, re-usable preparation operations for Minecraft servers. It handles mod installation, file management, version resolution, and configuration patching.
Version: 1.55.2
Repository: itzg/mc-image-helper
Repository: itzg/mc-image-helper
Overview
mc-image-helper is primarily used internally by the image’s startup scripts to:
- Install server types (Forge, Fabric, Paper, etc.)
- Download and manage mods from CurseForge, Modrinth, and other sources
- Resolve Minecraft versions
- Copy and synchronize files
- Patch JSON and YAML configuration files
- Manage user permissions (whitelist, ops, banned players)
Core Commands
Version Resolution
Resolve Minecraft version strings like “LATEST” or “SNAPSHOT” to actual version numbers:Java Version Detection
Get the major Java version running in the container:File Finding
Find files and directories with advanced filtering:--name- Filename pattern (glob)--type- Filter by type (file,directory)--max-depth- Maximum directory depth--format- Output format (%P= relative path,%f= filename)
File Copying
Advanced file copying with URL support and synchronization:Server Installation
Install Forge
--minecraft-version- Target Minecraft version--forge-version- Forge version (or “latest”, “recommended”)--forge-installer- Path to installer JAR--output-directory- Installation directory--results-file- JSON file with installation results--force-reinstall- Force reinstallation
Install Fabric
--minecraft-version- Target Minecraft version--loader-version- Fabric loader version--launcher-version- Fabric launcher version--output-directory- Installation directory
Install NeoForge
Install Quilt
Install Paper
--minecraft-version- Target Minecraft version--build- Build number or “latest”--output-directory- Installation directory--results-file- JSON file with installation results
Install Purpur
Mod Platform Integration
CurseForge Modpack Installation
--api-key- CurseForge API key--api-key-file- File containing API key--slug- Modpack slug--file-id- Specific file ID--page-url- Modpack page URL--filename-matcher- Filename pattern--exclude-mods- Mods to exclude (comma-separated)--force-include-mods- Mods to force include--exclude-include-file- JSON file with exclude/include rules--parallel-downloads- Number of parallel downloads (default: 4)--output-directory- Installation directory
CurseForge Files (Standalone Mods)
Modrinth Modpack Installation
--slug- Modpack slug--version-id- Specific version ID--version-type- Version type (release, beta, alpha)--exclude-mods- Mods to exclude--force-include-mods- Mods to force include--default-exclude-includes- Use default exclusions--output-directory- Installation directory
Modrinth Files (Standalone Mods/Plugins)
--project- Project ID or slug--version- Version pattern or ID--game-version- Minecraft version filter--loader- Mod loader filter (forge, fabric, quilt)--output-directory- Output directory
Configuration Management
Set Server Properties
Updateserver.properties with key-value pairs:
--prop- Property in formatkey=value(repeatable)--escape-unicode- Escape unicode characters
Interpolate Variables
Replace placeholders in files with environment variable values:${VAR}- Replace with environment variable${VAR:-default}- Use default if VAR not set${VAR:+value}- Use value if VAR is set
Patch JSON/YAML Files
Apply JSON path-based patches to configuration files:YAML Path Query
Extract values from YAML files:User Management
Manage Whitelist
Manage Operators
Manage Banned Players
--whitelist- Comma-separated list of players/UUIDs--whitelist-file- URL or path to whitelist JSON--ops- Comma-separated list of operators--ops-file- URL or path to ops JSON--banned-players- Comma-separated list--banned-players-file- URL or path to banned players JSON--output-directory- Data directory
Download Utilities
Maven Download
Download artifacts from Maven repositories:GitHub Latest Release
Download latest release asset from GitHub:Generic File Download
--url- File URL (repeatable)--output-directory- Output directory--output-filename- Custom filename--skip-up-to-date- Skip if already downloaded--skip-existing- Skip if file exists
Vanilla Tweaks
Install Vanilla Tweaks datapacks:--category- Category (datapacks, resourcepacks, craftingtweaks)--packs- Comma-separated pack names--version- Minecraft version--output-directory- Output directory
Advanced Features
Version Detection from Mods
Detect Minecraft version from Modrinth projects:Exclude/Include File Schema
For CurseForge and Modrinth, exclude/include files use this JSON schema:exclude- Project slugs or IDs to skipinclude- Project slugs or IDs to force includeglobal- Applied to all modpacksmodpacks- Per-modpack overrides
Common Patterns
Custom Mod Installation
Download mods from various sources:Server Migration
Find and copy server files:Dynamic Configuration
Patch configuration based on environment:Environment Variable Integration
Manymc-image-helper operations are triggered automatically by environment variables set on the container. See the Environment Variables Reference for the complete list.
Examples
TYPE=FORGEtriggersinstall-forgeCF_SLUG=modpack-nametriggersinstall-curseforgeMODRINTH_PROJECTS=sodium,lithiumtriggersmodrinthdownloads
Troubleshooting
Enable Debug Output
Add--debug flag to most commands:
Check Results Files
Many install commands write results to JSON files:Version Compatibility
Ensure Minecraft version matches mod/loader requirements:Related Commands
See also:- rcon-cli - Send commands to server
- mc-monitor - Monitor server health
- Environment Variables - Configuration reference