NeoForge

Integrate FastStats with NeoForge mods

Use dev.faststats.neoforge.NeoForgeContext for NeoForge mods. Requires Java 21+.

NeoForge supports Minecraft versions 1.21 to 26.2. Select both the SDK version and the Minecraft version range in your dependency version. You can find the available Minecraft version targets in the Maven repository.

Artifact: dev.faststats.metrics:neoforge

implementation("dev.faststats.metrics:neoforge:0.29.0+mc26.1-26.2")
include("dev.faststats.metrics:neoforge:0.29.0+mc26.1-26.2")

Use both implementation and include. FastStats is provided as a mod through jar-in-jar, so implementation puts it on your compile classpath and include bundles it into your mod JAR.

The version format is {sdk-version}+mc{from}-{to}, where {sdk-version} is the FastStats SDK version and {from}-{to} is the supported Minecraft version range for that artifact.

import dev.faststats.ErrorTracker;
import dev.faststats.Metrics;
import dev.faststats.neoforge.NeoForgeContext;
import net.neoforged.fml.common.Mod;

@Mod("example_mod")
public class ExampleMod {
    public static final ErrorTracker ERROR_TRACKER = ErrorTracker.contextAware();

    private final NeoForgeContext context = new NeoForgeContext.Factory("example_mod", "YOUR_TOKEN")
        .errorTrackerService(ERROR_TRACKER)
        .metrics(Metrics.Factory::create)
        .create();
}

Pass your mod ID, as defined in neoforge.mods.toml, to NeoForgeContext.Factory.

See Error Tracking for configuring error reporting.

View full example on GitHub