Nitea for Forge
Nitea reports the errors and crashes your mod causes to your dashboard, and lets players send bug reports and suggestions. This page takes you from nothing to your first reported error.
Starting a new mod? The mod configurator downloads a ready-to-run Forge mod with Nitea already set up, and can create your Nitea project for you. →Before you start
- A Forge mod built with ForgeGradle 7 (
net.minecraftforge.gradle), like Forge's current MDKs. - Java 21 for Minecraft 1.21.x, Java 25 for 26.x.
- A free account on nitea.cc.
1. Create a project
- Sign in at nitea.cc, open Projects and choose New project.
- Enter your mod's name and its mod ID, exactly as
modIdinmods.toml, and pick Forge. - Copy the SDK key (
nt_…). It's shown only once; you can regenerate it later.
2. Add Nitea to build.gradle
Pick your Minecraft version. Every code block on this page follows your choice.
- Minecraft 26.2
- Minecraft 26.1
- Minecraft 1.21.11
- Minecraft 1.21.1
plugins {
// next to net.minecraftforge.gradle
id 'net.minecraftforge.jarjar' version '0.2.3'
}
jarJar.register()
// The jar with Nitea inside is the one to release: build/libs/<mod>-<version>.jar
tasks.named('jar', Jar) {
archiveClassifier = 'slim'
}
tasks.named('jarJar') {
archiveClassifier = ''
}
repositories {
maven { url 'https://libraries.nitea.cc' }
}
dependencies {
implementation(jarJar("cc.nitea:nitea-forge-26.2:0.3.0"))
}
plugins {
// next to net.minecraftforge.gradle
id 'net.minecraftforge.jarjar' version '0.2.3'
}
jarJar.register()
// The jar with Nitea inside is the one to release: build/libs/<mod>-<version>.jar
tasks.named('jar', Jar) {
archiveClassifier = 'slim'
}
tasks.named('jarJar') {
archiveClassifier = ''
}
repositories {
maven { url 'https://libraries.nitea.cc' }
}
dependencies {
implementation(jarJar("cc.nitea:nitea-forge-26.1:0.3.0"))
}
plugins {
// next to net.minecraftforge.gradle
id 'net.minecraftforge.jarjar' version '0.2.3'
}
jarJar.register()
// The jar with Nitea inside is the one to release: build/libs/<mod>-<version>.jar
tasks.named('jar', Jar) {
archiveClassifier = 'slim'
}
tasks.named('jarJar') {
archiveClassifier = ''
}
repositories {
maven { url 'https://libraries.nitea.cc' }
}
dependencies {
implementation(jarJar("cc.nitea:nitea-forge-1.21.11:0.3.0"))
}
plugins {
// next to net.minecraftforge.gradle
id 'net.minecraftforge.jarjar' version '0.2.3'
}
jarJar.register()
// The jar with Nitea inside is the one to release: build/libs/<mod>-<version>.jar
tasks.named('jar', Jar) {
archiveClassifier = 'slim'
}
tasks.named('jarJar') {
archiveClassifier = ''
}
repositories {
maven { url 'https://libraries.nitea.cc' }
}
dependencies {
implementation(jarJar("cc.nitea:nitea-forge-1.21.1:0.3.0"))
}
- Forge's Jar-in-Jar plugin (
net.minecraftforge.jarjar) puts the Nitea jar inside your mod jar, so players never install anything extra. - That plugin writes the jar with Nitea inside as
-all.jar. The twoarchiveClassifierblocks make it your normalbuild/libs/<mod>-<version>.jar, and the one without Nitea becomes-slim.jar. Release the normal one. - When several mods bundle Nitea, Forge loads one copy, the newest. Every mod uses it, with one consent screen.
- Nitea is a game library, not a mod. Don't list it as a dependency in
mods.toml: there's no mod ID to depend on.
3. Add your SDK key
Create src/main/resources/nitea/<modid>.properties, with your mod ID in the file name:
sdkKey=nt_your_sdk_key
Keep it out of git:
src/main/resources/nitea/*.properties
The key can only send events to your project, never read anything, but there's no reason to publish it. To build releases in CI, see Build in CI.
4. Start Nitea
At the start of your mod constructor (the class annotated with @Mod):
- Minecraft 26.2
- Minecraft 26.1
- Minecraft 1.21.11
- Minecraft 1.21.1
import cc.nitea.Nitea;
import cc.nitea.NiteaClient;
import cc.nitea.NiteaOptions;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
@Mod(ExampleMod.MODID)
public final class ExampleMod {
public static final String MODID = "examplemod";
public static NiteaClient NITEA;
public ExampleMod(FMLJavaModLoadingContext context) {
NITEA = Nitea.init(NiteaOptions.builder(MODID)
.owner(ExampleMod.class)
.release(context.getContainer().getModInfo().getVersion().toString())
.gameDir(FMLPaths.GAMEDIR.get())
.build());
// the rest of your setup
}
}
import cc.nitea.Nitea;
import cc.nitea.NiteaClient;
import cc.nitea.NiteaOptions;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
@Mod(ExampleMod.MODID)
public final class ExampleMod {
public static final String MODID = "examplemod";
public static NiteaClient NITEA;
public ExampleMod(FMLJavaModLoadingContext context) {
NITEA = Nitea.init(NiteaOptions.builder(MODID)
.owner(ExampleMod.class)
.release(context.getContainer().getModInfo().getVersion().toString())
.gameDir(FMLPaths.GAMEDIR.get())
.build());
// the rest of your setup
}
}
import cc.nitea.Nitea;
import cc.nitea.NiteaClient;
import cc.nitea.NiteaOptions;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
@Mod(ExampleMod.MODID)
public final class ExampleMod {
public static final String MODID = "examplemod";
public static NiteaClient NITEA;
public ExampleMod(FMLJavaModLoadingContext context) {
NITEA = Nitea.init(NiteaOptions.builder(MODID)
.owner(ExampleMod.class)
.release(context.getContainer().getModInfo().getVersion().toString())
.gameDir(FMLPaths.GAMEDIR.get())
.build());
// the rest of your setup
}
}
import cc.nitea.Nitea;
import cc.nitea.NiteaClient;
import cc.nitea.NiteaOptions;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
@Mod(ExampleMod.MODID)
public final class ExampleMod {
public static final String MODID = "examplemod";
public static NiteaClient NITEA;
public ExampleMod(FMLJavaModLoadingContext context) {
NITEA = Nitea.init(NiteaOptions.builder(MODID)
.owner(ExampleMod.class)
.release(context.getContainer().getModInfo().getVersion().toString())
.gameDir(FMLPaths.GAMEDIR.get())
.build());
// the rest of your setup
}
}
Call Nitea.init first, so errors in the rest of your setup are reported too. owner tells Nitea which code is yours; release and gameDir come from Forge. All options are in the NiteaOptions reference.
You don't build a consent screen: Nitea shows its own, once for every mod using it.
5. Send a test error
-
Start the game:
./gradlew runClient. -
The first time the title screen opens, Nitea asks whether mods may send reports. Choose Allow reports. Nothing is ever sent before that.
-
Capture something from your mod, for example at the end of your constructor:
NITEA.captureException(new IllegalStateException("Hello from Nitea")); -
Open Issues in your dashboard. The error shows up within a few seconds, with its stack trace and the Minecraft, Forge, Java and OS versions.
That's it. Remove the test line before releasing.
What Nitea does from now on
- Uncaught exceptions your mod causes are reported automatically, and so are Minecraft crashes your mod causes, on the next launch. Errors caused by other mods are never sent to you. See Automatic reporting.
- Players choose. Reports are only sent after the player allows them on Nitea's consent screen, and they can change their mind from the Nitea button on the title screen. See Player consent.
- Dedicated servers have no screen: the server owner allows reports in a config file. See Dedicated servers.
Next steps
- Capture errors with levels, tags and messages.
- Add breadcrumbs, so every error comes with what your mod did before it.
- Let players send bug reports and suggestions, and show them on a public roadmap.
Forge notes
Check your jar. Open build/libs/<mod>-<version>.jar and check it contains META-INF/jarjar/nitea-forge-<minecraft>-<version>.jar. If Nitea is only in a -all.jar, the archiveClassifier blocks from step 2 are missing.
Nitea isn't in the mod list. That's expected: it's a game library (FMLModType: GAMELIBRARY) that runs next to Minecraft. Its consent screen and title screen button still show up.
Something doesn't work? See Troubleshooting. Adding .debug(true) to the options logs every request Nitea makes.