★ Founding developer program: Pro free for 90 days for the first 50 developers →
DocsProxies & mods

Proxies & mods

The same SDK and dashboard for proxy plugins and mods: one artifact per platform, the same calls, and the platform's own types.

Updated · by Skilled

One artifact per platform

PlatformArtifactStart it
Spigot, Paper, Purpur, Foliapluginanalytics-bukkitPluginAnalytics.start(this, key) in onEnable
Velocitypluginanalytics-velocityPluginAnalytics.start(this, server, dataDirectory, key) on ProxyInitializeEvent
BungeeCord, Waterfallpluginanalytics-bungeePluginAnalytics.start(this, key) in onEnable, analytics.stop() in onDisable
Fabric (servers and games)pluginanalytics-fabricPluginAnalytics.start("yourmodid", key) in onInitialize
NeoForge (servers and games)pluginanalytics-neoforgePluginAnalytics.start("yourmodid", key) in your @Mod constructor

All of them use the repository, version and relocation from Installation with their own artifact; Fabric and NeoForge mods also need the jar step shown below. Relocation is required everywhere. The class is always PluginAnalytics, and track, property, time, captureError, excludeConfig and the rest work the same.

Velocity

// build.gradle.kts: implementation("com.gamepathics:pluginanalytics-velocity:1.8.0")
@Plugin(id = "partyplus", name = "PartyPlus", version = "1.0.0")
public final class PartyPlus {
    private final ProxyServer server;
    private final Path dataDirectory;
    private PluginAnalytics analytics;

    @Inject
    public PartyPlus(ProxyServer server, @DataDirectory Path dataDirectory) {
        this.server = server;
        this.dataDirectory = dataDirectory;
    }

    @Subscribe
    public void onInit(ProxyInitializeEvent e) {
        analytics = PluginAnalytics.start(this, server, dataDirectory, "pa_your_key");
    }

    void createParty(Player leader) {
        analytics.track("party_created", leader);
    }
}

It stops by itself when the proxy shuts down. Velocity 3.5 and later (Java 21) are supported.

BungeeCord and Waterfall

// build.gradle.kts: implementation("com.gamepathics:pluginanalytics-bungee:1.8.0")
public final class PartyPlus extends Plugin {
    private PluginAnalytics analytics;

    @Override
    public void onEnable() {
        analytics = PluginAnalytics.start(this, "pa_your_key");
    }

    @Override
    public void onDisable() {
        analytics.stop(); // BungeeCord has no "plugin disabled" event: this sends the last batch
    }
}

Fabric

public final class SkyIslands implements ModInitializer {
    public static PluginAnalytics analytics;

    @Override
    public void onInitialize() {
        analytics = PluginAnalytics.start("skyislands", "pa_your_key");
    }
}

// anywhere: a player is their UUID
SkyIslands.analytics.track("island_created", player.getUuid());

With Fabric Loom, shade the SDK into the jar Loom remaps (add the Shadow plugin, id("com.gradleup.shadow") version "8.3.9"):

repositories {
    maven("https://pluginanalytics.dev/maven")
}

// The SDK goes into your mod's jar through this configuration, and only it.
val shade: Configuration by configurations.creating

dependencies {
    implementation("com.gamepathics:pluginanalytics-fabric:1.8.0")
    shade("com.gamepathics:pluginanalytics-fabric:1.8.0")
}

tasks.shadowJar {
    configurations = listOf(shade)
    archiveClassifier = "dev-shadow"
    relocate("com.gamepathics.pluginanalytics", "com.you.skyislands.libs.analytics")
}

tasks.remapJar {
    // The jar Fabric loads: the shaded one, remapped.
    inputFile = tasks.shadowJar.flatMap { it.archiveFile }
}

Don't use Loom's include() (jar-in-jar) for the SDK: it can't relocate it, so the SDK turns itself off.

The SDK doesn't depend on Minecraft classes, so one version works on every Minecraft version Fabric runs. On dedicated servers, player joins, the server thread (for Performance) and player counts come from Fabric API when it's installed; without it, your own track calls still work.

NeoForge

@Mod("skyislands")
public final class SkyIslands {
    public static PluginAnalytics analytics;

    public SkyIslands() {
        analytics = PluginAnalytics.start("skyislands", "pa_your_key");
    }
}

With ModDevGradle, ship the shaded jar (add the Shadow plugin, id("com.gradleup.shadow") version "8.3.9"):

repositories {
    maven("https://pluginanalytics.dev/maven")
}

// The SDK goes into your mod's jar through this configuration, and only it.
val shade: Configuration by configurations.creating

dependencies {
    implementation("com.gamepathics:pluginanalytics-neoforge:1.8.0")
    shade("com.gamepathics:pluginanalytics-neoforge:1.8.0")
}

tasks.shadowJar {
    configurations = listOf(shade)
    archiveClassifier = ""
    relocate("com.gamepathics.pluginanalytics", "com.you.skyislands.libs.analytics")
}

// The plain jar doesn't carry the SDK: ship the shaded one.
tasks.jar { archiveClassifier = "slim" }
tasks.build { dependsOn(tasks.shadowJar) }

Don't use jarJar for the SDK: it can't relocate it, so the SDK turns itself off.

Mods in players' games

The Fabric and NeoForge SDKs also run on the client. There, every install of the game is one anonymous "server" in your dashboard (shown as Fabric (client) or NeoForge (client)), and every player event belongs to that install:

  • Nothing identifies the player: no name, account, UUID or IP. The install is a random id with its own salt.
  • The first batch goes out 60 to 90 seconds after the game starts; then data goes out over HTTPS every 30 minutes and when the game closes, never over a held-open connection.
  • Players turn it off for every mod in config/pluginanalytics.yml (enabled: false).
  • Say in your mod's description that it collects anonymous usage statistics. Modrinth asks for a "Contains telemetry" disclosure.
  • To ask first, call requireConsent() after start: the player sees Minecraft's Yes/No screen once, over the title screen, and nothing is sent until they say yes. requireConsent

Each active install counts toward your plan like a server does.

What each platform supports

BukkitVelocity, BungeeCordFabric, NeoForge serversGames (clients)
Servers, versions, players✓✓ (the proxy and its players)✓✓ (one install, one player)
Events, properties, funnels, retention✓✓✓✓
Errors and logs✓✓✓✓
Config usageconfig.ymlconfig.yml, .json or .properties in the data folder (.toml too on Velocity)config/<modid>-server.toml or -common.toml (NeoForge), or config/<modid>.json, .json5, .toml, .properties or .ymlsame as servers
Performance by method✓ (not Folia)spans only (no main thread)✓ with Fabric API / on NeoForgespans only
Automatic command events and timing✓ (not Folia)–––
Update noticesconsole and admins in gameconsole and players with the notify permissionconsole (and operators in game on NeoForge)log
Bug reports and ideas/<plugin> report|suggest (not on Folia), or report()report() and suggest() from your commandsreport() and suggest()report() and suggest()