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.27.2+mc26.1-26.2")

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