Custom Events
Track any action that matters to your server. Custom events let you capture specific player behaviors — completing quests, entering PvP zones, opening crates, or anything else you want to measure.
Setup
Step 1: Plan Your Events
Decide what actions you want to track. Good events are:
- Specific: "completed_tutorial" not "did_something"
- Actionable: Data you'll actually use to make decisions
- Measurable: Clear success/failure states
Step 2: Integrate with Your Plugin
Use the Analyse API to track events:
import net.analyse.api.Analyse;// Basic eventAnalyse.trackEvent("opened_crate").withPlayer(player.getUniqueId(), player.getName()).send();// Event with propertiesAnalyse.trackEvent("opened_crate").withPlayer(player.getUniqueId(), player.getName()).withData("crate_type", "legendary").withData("reward", "diamond_sword").send();
Step 3: View in Dashboard
Events appear in your dashboard within seconds. Filter by event name, date range, or player to analyze behavior.
Event Properties
Add context to your events with properties:
Analyse.trackEvent("quest_completed").withPlayer(player.getUniqueId(), player.getName()).withData("quest_name", "dragon_slayer").withData("time_taken_minutes", 45).withData("deaths", 3).withValue(500.0) // Optional numeric value for aggregations.send();
Properties let you segment your data: "How many players completed dragon_slayer with zero deaths?"
Best Practices
- Use consistent naming —
snake_casefor event names - Don't over-track — Focus on events you'll actually analyze
- Include useful properties — Add context that helps segmentation
- Track both start and end — Measure completion rates with pairs