KTale is a lightweight, Kotlin-first helper library for building Hytale Server plugins. It focuses on small, composable utilities and extension functions that stay close to the underlying Hytale API while cutting boilerplate.
- API reference (Dokka): https://modlabscc.github.io/ktale/
- Guides (in this repo):
KTale is published as a Maven artifact:
- Group:
cc.modlabs - Artifact:
ktale - Version: calendar-based (example:
2026.1.15.2109)
repositories {
maven("https://nexus.modlabs.cc/repository/maven-mirrors/")
}
dependencies {
implementation("cc.modlabs:ktale:<version>")
}Note: Hytale’s server API is expected to be provided by the server runtime (your plugin compiles against it, but you typically don’t ship it).
KTale is organized into small packages (see the API reference for full details):
cc.modlabs.ktale.ext: Kotlin extensions for common plugin tasks (messaging, titles, notifications, permissions, teleport helpers, vector math, etc.).cc.modlabs.ktale.text: A small MiniMessage-like layer for building HytaleMessageobjects (MessageBuilder).cc.modlabs.ktale.ui: Helpers for Hytale custom UI:UiPathpath helpers (e.g."#Node.Value")UICommandBuilder/UIEventBuilderconvenience extensionsCustomUIPage<T>base class +ui { ... }build scope
cc.modlabs.ktale.entitystats: Entity stat helpers (EntityStats,Player.entityStatMapOrNull(),EntityStatMap.metaSnapshot(), etc.).cc.modlabs.ktale.blocks: Block utilities (drop computation helpers and small type heuristics likeBlockType.isOre()).cc.modlabs.ktale.util: Reusable utilities likeCooldowns<K>for thread-safe ability/command cooldown tracking.
import cc.modlabs.ktale.ext.send
player.send("<red>Hello <bold>World</bold></red>")
player.send("<gradient:red:blue>Gradient text</gradient>")
player.send("<#FFAA00>Hex colors</#FFAA00>")import cc.modlabs.ktale.ext.*
val a = vec3d(1.0, 2.0, 3.0)
val b = vec3d(4.0, 5.0, 6.0)
val sum = a + b
val dist = a.distanceTo(b)
val mid = a.lerp(b, 0.5)
val dir = (b - a).normalized()import cc.modlabs.ktale.util.Cooldowns
val abilityCooldowns = Cooldowns<UUID>()
if (abilityCooldowns.isReady(player.uuid!!)) {
// fire ability
abilityCooldowns.set(player.uuid!!, 3000L) // 3 second cooldown
}See the full guide in docs/custom-guis.mdx. At a high level, KTale helps keep UICommandBuilder + UIEventBuilder wiring concise and provides CustomUIPage<T> update helpers.
GPL-3.0 — see LICENSE.