Skip to main content

Nitea for Fabric

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 Fabric mod built with Fabric Loom: net.fabricmc.fabric-loom on Minecraft 26.x, net.fabricmc.fabric-loom-remap on 1.21.x.
  • Java 21 for Minecraft 1.21.x, Java 25 for 26.x.
  • A free account on nitea.cc.

You don't need Fabric API.

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 id in fabric.mod.json, and pick Fabric.
  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 (net.fabricmc.fabric-loom)
repositories {
maven { url 'https://libraries.nitea.cc' }
}

dependencies {
include(implementation("cc.nitea:nitea-fabric-26.2:0.3.0"))
}
  • include puts the Nitea jar inside your mod jar, so players never install anything extra.
  • When several mods bundle Nitea, Fabric loads one copy, the newest. Every mod uses it, with one consent screen.
  • Don't add Nitea to depends in fabric.mod.json: the copy you bundle is always there.
  • On 1.21.x Loom remaps mods, so it's modImplementation. From 26.1 Minecraft isn't obfuscated and it's a plain implementation.

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​

In your main entrypoint (the class under entrypoints.main in fabric.mod.json), at the start of onInitialize():

ExampleMod.java
import cc.nitea.Nitea;
import cc.nitea.NiteaClient;
import cc.nitea.NiteaOptions;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;

public final class ExampleMod implements ModInitializer {
public static final String MODID = "examplemod";
public static NiteaClient NITEA;

@Override
public void onInitialize() {
FabricLoader loader = FabricLoader.getInstance();
NITEA = Nitea.init(NiteaOptions.builder(MODID)
.owner(ExampleMod.class)
.release(loader.getModContainer(MODID).orElseThrow().getMetadata().getVersion().getFriendlyString())
.gameDir(loader.getGameDir())
.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 Fabric Loader. 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 onInitialize():

    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, Fabric, 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​

Fabric notes​

Nitea in the mod list. On Fabric, Nitea is a small library mod with the ID nitea and no entry point. Mod Menu lists it under libraries.

Mod IDs with dashes. Fabric allows - in mod IDs and so does Nitea. In the environment variable for the key it becomes _: for my-mod it's NITEA_MY_MOD_SDK_KEY.

Mixins. Errors thrown by code your mixins inject into Minecraft are reported by your mod, like errors in your own classes.

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