---
url: https://docs.sunlicense.com/guide/hytale-plugin.md
description: >-
  A Hytale server plugin template with SunLicense built in - the key from
  config.json or a BuiltByBit placeholder, an offline license fallback, and
  servers that keep running when SunLicense is unreachable.
---

# Hytale plugin template

A Hytale server plugin with SunLicense built in, to copy and build on:
**[github.com/sunlicense-com/example-hytale-plugin](https://github.com/sunlicense-com/example-hytale-plugin)**
(MIT No Attribution: copy any of it without credit). It's the [Paper plugin template](/guide/paper-plugin)
ported to Hytale's own plugin API.

* Gradle + Shadow, built against Hypixel's official server jar (`maven.hytale.com`) with Java 25, and the [Java SDK](/guide/sdks) relocated into your own package
* The license key from the plugin's `config.json`, or built in by [BuiltByBit](/integrations/builtbybit) and [Voxel Shop](/integrations/voxel-shop) placeholders
* A clear console message for every [result code](/guide/concepts#validation-result-codes), keys masked
* A re-check every few hours, so [revoking](/guide/concepts#license) a leaked key switches the plugin off on running servers
* An [offline license](/guide/offline-licenses) fallback, and the plugin keeps running if SunLicense can't be reached (your choice)
* Tests against a stub server, `manifest.json` and `config.json` checked with Hytale's own codecs, a GitHub Actions workflow and an `AGENTS.md` for AI assistants

## Get started

1. In the dashboard, create a product and a policy (machines = servers), and an **API key**.
2. Use the template on GitHub (**Use this template**), rename `com.example.myplugin` and the manifest's
   `Group` and `Name`, and put the key in `~/.gradle/gradle.properties` as `sunlicenseApiKey=slk_...` (never in git).
3. `./gradlew build`, then put `build/libs/my-plugin-1.0.0.jar` in a Hytale server's `mods/` folder.
4. Register your commands and events in `MyPlugin.setup()`, each starting with `if (!MyPlugin.active()) return;`.

The server owner's key goes in `mods/<Group>_<Name>/config.json` (`LicenseKey`), unless a store placeholder
built it into the jar. `/myplugin status` and `/myplugin recheck` show and re-check the license.

Hytale is in early access and its plugin API changes between updates: the template says which server
version it's built against (`hytaleVersion` in `gradle.properties`), and its README lists what has been
checked on a real server so far.

::: tip Selling on BuiltByBit
BuiltByBit has a Hytale category, and the `%%__SUNLICENSE__%%` placeholder works the same as for
Minecraft. Say in the listing that the plugin checks its license online, and that servers keep running
when the check can't reach SunLicense.
:::
