Java SDK
Build custom integrations with your Minecraft plugins. The Analyse SDK gives you programmatic access to event tracking, A/B testing, and session management.
Why Use the SDK?
The Analyse plugin handles basic analytics automatically. Use the SDK when you want to:
- Track custom events — Crate opens, quest completions, PvP kills
- Run A/B tests — Show different experiences to different players
- Access session data — Get player hostnames, join times, session IDs
- Build advanced integrations — Create automated workflows based on analytics
Quick Example
import net.analyse.api.Analyse;// Track a custom eventAnalyse.trackEvent("crate_opened").withPlayer(player.getUniqueId(), player.getName()).withData("crate_type", "legendary").withData("reward", "diamond_sword").send();// A/B test different rewardsString variant = Analyse.getVariant(player.getUniqueId(), "crate-rewards");if ("boosted".equals(variant)) {giveDoubleRewards(player);}
Requirements
- Java 17+
- Analyse plugin installed and configured on the server
- Paper, Velocity, or BungeeCord server
Getting Started
| Step | Description |
|---|---|
| Installation | Add the SDK to your project |
| Event Tracking | Track custom player actions |
| A/B Testing | Run experiments in your plugin |
| Sessions | Access player session data |
| Plugin Messaging | Send events through your proxy |
| API Reference | Complete method reference |
Package Structure
net.analyse.api├── Analyse # Main entry point (static methods)├── manager/│ ├── ABTestManager # A/B test operations│ └── SessionManager # Player session access├── messaging/│ ├── AnalyseMessaging # Send events via plugin messages│ └── AnalyseMessageParser # Parse incoming messages (proxy-side)├── object/│ ├── abtest/│ │ ├── ABTest # Test configuration│ │ └── Variant # Test variant│ └── builder/│ └── EventBuilder # Fluent event builder└── session/└── PlayerSession # Session data interface