A quick reference of every public class and method the API exposes. Use this page to scan; use the other pages for worked examples.
net.analyse.api.Analyse
Static entry point. You'll touch this class more than any other.
Availability
| Method | Returns | What it does |
|---|
isAvailable() | boolean | True when the Analyse plugin is loaded. Always check this first. |
isConnected() | boolean | True when the last API call succeeded (fresh heartbeat). |
getLastConnectionError() | String | The reason the last call failed, or null if healthy. |
Events
| Method | Returns | What it does |
|---|
trackEvent(String name) | EventBuilder | Start a fluent builder for a custom event. |
trackEvent(String name, UUID uuid, String username) | EventBuilder | Same as above with the player preset. |
trackEvent(String name, Map<String, Object> data) | EventBuilder | Same as above with properties preset. |
A/B tests
| Method | Returns | What it does |
|---|
getVariant(UUID, String testKey) | String | The variant key assigned to the player. null when the test isn't active. |
isTestActive(String testKey) | boolean | True when the test is running. |
getActiveTests() | List<? extends ABTest> | Every currently active test. |
getTest(String testKey) | ABTest | The test by key, or null. |
trackConversion(UUID, String username, String testKey, String eventName) | void | Record a conversion for a test. |
Managers
| Method | Returns | What it does |
|---|
get() | AnalysePlatform | The current platform (Spigot, Velocity, etc). |
sessions() | SessionManager | Live sessions. |
abTests() | ABTestManager | A/B test manager. |
net.analyse.api.object.builder.EventBuilder
Returned by Analyse.trackEvent(...).
| Method | Returns | What it does |
|---|
withPlayer(UUID, String username) | EventBuilder | Link the event to a player. |
withPlayer(UUID) | EventBuilder | Link by UUID only. |
withData(String key, Object value) | EventBuilder | Add a property. |
withData(Map<String, Object>) | EventBuilder | Add multiple properties at once. |
withValue(double) | EventBuilder | Set the numeric main value. |
send() | void | Send the event. Non-blocking. |
net.analyse.api.manager.SessionManager
| Method | Returns | What it does |
|---|
getSession(UUID) | Optional<PlayerSession> | The session for an online player. |
hasSession(UUID) | boolean | True when the player has an active session. |
getAllSessions() | Collection<PlayerSession> | Every active session. |
getSessionCount() | int | Current session count. |
net.analyse.api.session.PlayerSession
| Method | Returns | What it does |
|---|
getPlayerUuid() | UUID | The Minecraft UUID. |
getHostname() | String | The hostname they joined through. |
getJoinTime() | Instant | When they joined. |
hasActiveSession() | boolean | True once Analyse has confirmed the session. |
net.analyse.api.manager.ABTestManager
| Method | Returns | What it does |
|---|
getVariant(UUID, String testKey) | String | Variant key for the player. |
getActiveTests() | List<? extends ABTest> | Active tests. |
getTest(String testKey) | ABTest | A test by key. |
isTestActive(String testKey) | boolean | Whether a test is live. |
trackConversion(UUID, String username, String testKey, String eventName) | void | Record a conversion. |
net.analyse.api.object.abtest.ABTest
| Method | Returns | What it does |
|---|
getKey() | String | The test key you use to look it up. |
getName() | String | The human readable name. |
isActive() | boolean | Whether it's running right now. |
getVariants() | List<Variant> | All configured variants. |
net.analyse.api.messaging.AnalyseMessaging
Used from backend servers behind a proxy to push events through plugin messaging.
| Method | Returns | What it does |
|---|
event(String name) | EventMessageBuilder | Fluent builder for an event message. |
createEventMessage(name, uuid, username, data, value) | byte[] | Build the raw bytes directly. |
createConversionMessage(uuid, username, testKey, eventName) | byte[] | Build a conversion message. |
CHANNEL | String | The plugin channel name (analyse:events). |