Skip to content

Hoglin SDK Reference

The Hoglin SDK lets you track any event from your Minecraft server plugin with just a few lines of code. This page documents all available classes, methods, and configuration options.


See Getting Started for installation instructions.


The main entrypoint for creating a Hoglin instance.

val analytics = Hoglin.Builder("<your server key>")
.autoFlushInterval(5_000L)
.maxBatchSize(50)
.build()
MethodTypeDefaultDescription
autoFlushInterval(ms)Long5000How often (ms) to send queued events
maxBatchSize(n)Int50Max events sent per batch
enableAutoFlush(b)BooleantrueWhether to auto-flush events
baseUrl(url)Stringhttps://api.hoglin.ggAPI endpoint (should never be used, outside of certain circumstances)

track(eventType: String, properties: Map<String, Any>)

Section titled “track(eventType: String, properties: Map<String, Any>)”

Tracks a custom event.

analytics.track("player_join", mapOf(
"player_uuid" to event.player.uniqueId
))
  • eventType: Name of the event (e.g. "player_join")
  • properties: Key-value pairs of event data (any serializable value)

Immediately sends all queued events to the server.

analytics.flush();

Stops the auto-flushing task and flushes all current events (call this in onDisable or equivalent).

analytics.shutdownBlocking()

Each event you send with the SDK has:

FieldTypeDescription
event_typeStringName of the event
timestampLong (ms)When the event was tracked
propertiesMap<String,Any>Your custom event data

  • The SDK queues events locally and retries if the API is unavailable.
  • No events are lost unless the server is stopped before flushing.
  • Use flush() or shutdownBlocking() to ensure all events are sent.

val analytics = Hoglin.Builder("<your server key>")
.autoFlushInterval(5_000L)
.maxBatchSize(50)
.build()
analytics.track("player_death", mapOf(
"player_uuid" to player.uniqueId,
"cause" to event.deathMessage
))


  • What happens if my server loses connection?

    Events are queued and retried automatically.

  • Is there a limit to property keys/values?

    No hard limit, but keep payloads reasonable for performance.