Setting Up a NeoForge Add-on Workspace
This guide explains how to create a NeoForge mod that depends on Origins.
Prerequisites
- Java 21 JDK
- An IDE (IntelliJ IDEA recommended)
- Basic familiarity with NeoForge mod development
If you've never made a NeoForge mod before, work through the NeoForge documentation first.
Step 1 — Generate the Project
Use the official NeoForge Mod Generator to scaffold your project:
- Open https://neoforged.net/mod-generator/ in your browser.
- Select the Minecraft version you're targeting.
- Fill in your mod's metadata (mod ID, group, version).
- Click Generate and download the ZIP.
- Extract the ZIP and open the folder in IntelliJ IDEA.
The generator produces a fully working NeoForge mod project with the correct Gradle setup — no manual build.gradle editing needed. Run gradlew runClient once to verify everything works before proceeding.
Step 2 — Add Origins as a Dependency
Origins (NeoForge) is available via CourseForge and Modrinth. Add the repository and dependency to your build.gradle:
repositories {
maven { url = "https://api.modrinth.com/maven" }
}
dependencies {
implementation "maven.modrinth:origins-neoforge:VERSION"
}
Replace VERSION with the version you're targeting. Check Modrinth for the latest.
Step 3 — Verify
Refresh Gradle (gradlew --refresh-dependencies) and run gradlew runClient. Join a world — if the origin selection screen appears, Origins is loaded and your workspace is ready.
Step 4 — Using Origins APIs
The main package is com.iafenvoy.origins. Key classes for add-on development:
| Class | Purpose |
|---|---|
OriginDataHolder | Read/write origin/power data on entities |
OriginsRegistries | Access built-in and dynamic registries |
PowerRegistries | Register custom power types |
ConditionRegistries | Register custom condition types |
ActionRegistries | Register custom action types |
Custom power types extend com.iafenvoy.origins.data.power.Power and provide a MapCodec for JSON deserialization. Register them through the appropriate DeferredRegister using the registry keys in the registries classes.
For examples, browse the built-in power implementations under com.iafenvoy.origins.data.power.builtin.
Next: see Architecture Overview for the project structure and design patterns.