Getting Started %5Bminecraft 1.21 And 1.21.1%5D
Note
Version note: This page covers Minecraft 1.21 and 1.21.1 for NeoForge, Forge, and Fabric.
Other setup pages:
- Minecraft 1.12.2: Getting Started
- Minecraft 1.16.5: Getting Started
- Minecraft 1.18.2, 1.19.2, and 1.20.1: Getting Started
- Minecraft 1.21.11: Getting Started
- Minecraft 26.1.2 and 26.2: Getting Started
You can integrate and automatically download JEI for your mod project using Gradle.
Just add the following to your build script (build.gradle):
repositories {
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = ""
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = ""
}
}dependencies {
/* other minecraft dependencies are here */
// compile against the JEI API but do not include it at runtime
compileOnly("mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}")
// at runtime, use the full JEI jar for NeoForge
runtimeOnly("mezz.jei:jei-${mc_version}-neoforge:${jei_version}")
}dependencies {
/* other minecraft dependencies are here */
// compile against the JEI API but do not include it at runtime
compileOnly("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
// at runtime, use the full JEI jar for Forge
runtimeOnly("mezz.jei:jei-${mc_version}-forge:${jei_version}")
}dependencies {
/* other minecraft dependencies are here */
// compile against the JEI API but do not include it at runtime
modCompileOnly("mezz.jei:jei-${mc_version}-fabric-api:${jei_version}")
// at runtime, use the full JEI jar for Fabric
modRuntimeOnly("mezz.jei:jei-${mc_version}-fabric:${jei_version}")
}${mc_version} gets replaced by the Minecraft version you are targeting on this page. (i.e. 1.21 or 1.21.1)
${jei_version} gets replaced by the version of JEI you want to use (i.e. 19.5.0.59)
The platform API artifacts depend on jei-${mc_version}-common-api in their Maven POMs, so you do not need to declare common-api separately.
For a list of available JEI versions, see the badges below or click any one of them to be take to the maven listing.
These properties can be set in a file named gradle.properties, placed in the same directory as your build.gradle file.
For this example, your gradle.properties would look like this:
mc_version=1.21
jei_version=19.5.0.59The example script only compiles against the API, which is very stable. When you run your mod (runtime), the full JEI will run as well so that you can still test with it in development.
If you make the mistake of compiling against the full mod jar and then use classes from JEI that are not in the API, your mod could break any time JEI updates.