-
Notifications
You must be signed in to change notification settings - Fork 0
Setup Instructions
This is a NeoForge mod template for Minecraft 1.21.1. Follow these steps to set up your new mod:
Before you begin, make sure you have:
- ✅ Java 21 or newer installed (Download here)
- ✅ VS Code (recommended) or another IDE
- ✅ Git (optional, but recommended for version control)
Verify Java installation:
java -versionYou should see Java version 21 or higher.
Edit gradle.properties and change the following properties:
mod_id=yourmodid # Change to your unique mod ID (lowercase, no spaces, underscores allowed)
mod_name=Your Mod Name # Change to your mod's display name
mod_version=1.0.0 # Set your initial version
mod_description=Your mod description here
mod_authors=Your Name # Change to your name
mod_credits=Credits here # Add any credits (optional)Edit settings.gradle and change:
rootProject.name = 'yourmodid' # Change to match your mod_idCreate your main mod class at:
src/main/java/net/yourmodid/YourModName.java
Example structure:
package net.yourmodid;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
@Mod(YourModName.MOD_ID)
public class YourModName {
public static final String MOD_ID = "yourmodid";
public YourModName(IEventBus modEventBus) {
// Register mod setup here
}
}The following folder structure is already created:
-
src/main/resources/assets/yourmodid/- For client-side resources (textures, models, sounds) -
src/main/resources/data/yourmodid/- For data packs (recipes, loot tables, tags) -
src/main/resources/META-INF/- For mod metadata
You'll need to rename the yourmodid folders to match your actual mod ID.
Place a logo image in src/main/resources/ named yourmodid.png (where yourmodid is your mod ID).
Run the Gradle build:
./gradlew buildThis will download all dependencies and build your mod for the first time.
Use the VS Code launch configurations:
- Client: Runs the Minecraft client with your mod
- Server: Runs a dedicated server with your mod
- Data: Generates data files (recipes, loot tables, etc.)
- GameTestServer: Runs automated tests
Note: The first run will take some time as it downloads Minecraft and sets up the development environment.
yourmodid/
├── .vscode/ # VS Code launch configurations
├── gradle/ # Gradle wrapper files
├── src/
│ └── main/
│ ├── java/ # Java source code
│ │ └── net/
│ │ └── yourmodid/
│ └── resources/ # Resources
│ ├── assets/ # Client resources
│ │ └── yourmodid/
│ ├── data/ # Data packs
│ │ └── yourmodid/
│ └── META-INF/ # Mod metadata
├── build.gradle # Gradle build script
├── gradle.properties # Mod properties
├── settings.gradle # Gradle settings
└── README.md # This file
- If you get build errors, make sure you have Java 21 installed
- Delete the
.gradleandbuildfolders and run./gradlew buildagain if you encounter caching issues - Make sure your
mod_idingradle.propertiesmatches your folder names inresources/
Next: Check out the Setup Checklist for a complete step-by-step guide.
Navigation
Quick Links
Template Info
Version: 1.0.0
Minecraft: 1.21.1
NeoForge: 21.1.57
Java: 21