A clean, modern, and ready-to-use template for Minecraft Forge mod development using Parchment mappings.
- Requirements
- Quick Start
- Project Structure
- .gitignore Configuration
- Configuration
- Development
- Contributing
- License
Before you begin, ensure you have met the following requirements:
- Java Development Kit (JDK) 17 or higher (Eclipse Temurin is recommended)
- Git (for version control)
- An IDE of your choice (IntelliJ IDEA Community is highly recommended)
Get your development environment running in just a few minutes:
git clone <your-repository-url>
cd mod-template# On Windows
gradlew build
# On Linux/Mac
./gradlew build# Launch Minecraft Client
./gradlew runClient
# Launch Minecraft Server
./gradlew runServerHere is a quick overview of the essential files and folders in this template:
mod-template/
├── src/
│ ├── main/
│ │ ├── java/ # Your mod's source code goes here
│ │ └── resources/ # Textures, models, sounds, and recipes
│ ├── test/ # Unit testing
│ └── generated/ # Auto-generated resources (from runData)
├── gradle/ # Gradle wrapper files
├── run/ # Client execution directory (sandbox)
├── run-data/ # Data generation sandbox
├── build.gradle # Main build script and dependencies
├── gradle.properties # Project variables (Minecraft version, Mod ID, etc.)
└── settings.gradle # Gradle project settings
This template includes a carefully configured .gitignore that filters out files unnecessary for development while preserving template essentials:
build/- Compiled classes and artifacts (regenerated on build)run/logs/- Client/Server logsrun/saves/- Minecraft world savesrun/mods/- Downloaded mods- IDE files -
.idea/,*.iml, etc. (IntelliJ) - OS files -
.DS_Store,Thumbs.db, etc.
run/config/- Mod configuration filesrun/defaultconfigs/- Default configuration templatessrc/- All source code and resources- Gradle files -
gradle/,build.gradle,gradle.properties
Note: The build/ directory is safe to exclude because it regenerates automatically when you run ./gradlew clean build or any gradle task.
All the main configuration happens inside the gradle.properties file. It's the central hub for your mod's identity.
Change these values to match your mod:
mod_id=examplemod
mod_name=Example Mod
mod_version=0.0.1
mod_authors=yourname
mod_group_id=com.yourname.examplemod
mod_description=Example Mod by yourname
minecraft_version=1.20.1
forge_version=47.4.16
mapping_channel=parchment
mapping_version=2024.02.18-1.20.1Note: This template uses Parchment mappings by default for highly readable parameter names and Javadocs. Check their documentation for version changes.
Open build.gradle and locate the dependencies {} block. You can easily add external mods:
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
// Example: Adding Just Enough Items (JEI)
// compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
// runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
}| Task | Command | Description |
|---|---|---|
| Clean | ./gradlew clean |
Deletes the build/ directory |
| Build | ./gradlew build |
Compiles code and packages the mod .jar |
| DataGen | ./gradlew runData |
Runs data generators (recipes, loot tables) |
| IDE Setup | ./gradlew genIntellijRuns |
Re-generates IntelliJ run configurations |
When syncing or building the project, you might see the following warnings in your console. Both are completely harmless and can be safely ignored:
Deprecated Gradle features were used in this build...This is caused by internal Forge plugins (like ForgeGradle) using older Gradle APIs. It does not affect your mod. This template hides these warnings by default usingorg.gradle.warning.mode=noneingradle.properties.Cannot resolve resource filtering of MatchingCopyAction...This is a known visual bug in IntelliJ IDEA when it encounters theexpandlogic inbuild.gradle(used to replace properties inmods.toml). Since IntelliJ delegates the actual build process to Gradle by default, this warning will not cause any issues or failed builds.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to report a bug, request a new feature, or let me know about outdated dependencies.
This project is licensed under the MIT License - see the LICENSE.md file for details.