Skip to main content

Nitea for NeoForge

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.

Before you start​

  • A NeoForge mod built with ModDevGradle (net.neoforged.moddev). For Minecraft 1.20.1, ModDevGradle Legacy (net.neoforged.moddev.legacyforge).
  • Java 17 for Minecraft 1.20.1, Java 21 for 1.21.x, Java 25 for 26.x.
  • A free account on nitea.cc.

1. Create a project​

  1. Sign in at nitea.cc, open Projects and choose New project.
  2. Enter your mod's name and its mod ID, exactly as modId in neoforge.mods.toml, and pick NeoForge.
  3. 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.

build.gradle (ModDevGradle)
repositories {
maven { url 'https://libraries.nitea.cc' }
}

dependencies {
jarJar(implementation("cc.nitea:nitea-neoforge-26.2:0.3.0"))
}
  • jarJar puts the Nitea jar inside your mod jar, so players never install anything extra.
  • When several mods bundle Nitea, NeoForge 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 neoforge.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:

src/main/resources/nitea/examplemod.properties
sdkKey=nt_your_sdk_key

Keep it out of git:

.gitignore
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):

ExampleMod.java
import cc.nitea.Nitea;
import cc.nitea.NiteaClient;
import cc.nitea.NiteaOptions;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.loading.FMLPaths;

@Mod(ExampleMod.MODID)
public final class ExampleMod {
public static final String MODID = "examplemod";
public static NiteaClient NITEA;

public ExampleMod(IEventBus modEventBus, ModContainer modContainer) {
NITEA = Nitea.init(NiteaOptions.builder(MODID)
.owner(ExampleMod.class)
.release(modContainer.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 NeoForge. 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​

  1. Start the game: ./gradlew runClient.

  2. The first time the title screen opens, Nitea asks whether mods may send reports. Choose Allow reports. Nothing is ever sent before that.

  3. Capture something from your mod, for example at the end of your constructor:

    NITEA.captureException(new IllegalStateException("Hello from Nitea"));
  4. Open Issues in your dashboard. The error shows up within a few seconds, with its stack trace and the Minecraft, NeoForge, 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​

NeoForge notes​

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.

Minecraft 1.20.1. NeoForge for 1.20.1 is a fork of Forge 47: it still uses the net.minecraftforge packages, META-INF/mods.toml and a mod constructor without parameters. The dependency is a modImplementation so it's remapped like your other mod dependencies. The 1.20.1 tabs above show the right code.

Something doesn't work? See Troubleshooting. Adding .debug(true) to the options logs every request Nitea makes.