How to protect a Hytale plugin from leaks

Latch team · 2026-12-05 · 6 min read

Hytale server plugins are Java .jar files. The server owner drops them into the server's mods/ folder and they load on the next start, as the official server manual describes. That simplicity is great for installing plugins. It also means that once your JAR leaves your hands, anyone who gets a copy can open it, read it and run it on their own server.

This post covers why a Hytale plugin is so easy to copy, what developers usually do about it, where those measures stop working, and how Latch handles a Hytale plugin.

Why a Hytale plugin JAR is easy to read

Java compiles to bytecode, and bytecode keeps a lot of the original structure: class names, method names, string constants and the shape of your logic. Free decompilers such as Vineflower and CFR turn a .class file back into Java that reads close to the original source. Opening a JAR takes minutes, not skill.

In the Hytale community, decompiling is a normal part of the job. In the Hytale Modding Strategy and Status post from November 2025, Hytale's Technical Director wrote that "the server is not obfuscated, so you can decompile it easily", and recommended reading the implementation while documentation catches up. The server code has since been published under the Hytale Shared Source Agreement, and community guides like this one on hytalemodding.dev point plugin developers to it.

That openness is good for modding. For you, it means the people most likely to get your JAR already have the tools and the habit to look inside it. And reading isn't even needed for a leak: a copied JAR runs on any server where someone puts it in mods/.

What developers usually try

Obfuscation

Tools like ProGuard rename classes, methods and fields to meaningless names and strip unused code. Commercial obfuscators add string encryption and control-flow changes. This makes decompiled output much harder to follow.

The limits:

  • Calls into the Hytale server API keep their real names, because they have to match the server's classes. Those calls show what your plugin does.
  • Your entry class, the one named in manifest.json, has to keep its name too.
  • An obfuscated JAR is still a working JAR. Someone who just wants to run your plugin without paying doesn't need to read a single line.

Obfuscation slows down people who want to understand or copy your logic. It does nothing about a JAR passed around a Discord server.

License checks in your own code

The next step is a license check: on startup, the plugin calls a server you run, sends a key and refuses to start if the answer is no. This stops casual sharing, but the check lives in the same JAR the other person has. Find the method that makes the decision, change it to always return true, repackage, and the check is gone. Obfuscation makes that method harder to find; it doesn't make it impossible to patch.

You also take on a backend to run: key storage, a validation endpoint, revocation, and a plan for what happens when your server is down. We cover that side in Hytale plugin license keys without building your own system.

Marketplace placeholders

Marketplaces can mark each download. BuiltByBit, which has a Hytale resources category, replaces anti-piracy placeholders such as %%__USER__%% and %%__NONCE__%% with download details, and it processes .jar files and string constants in .class files.

Their own documentation is candid about the limits. Only the nonce is useful for tracing a leak, because a leaker can search for their own user ID and delete it. Obfuscation can rename placeholders so they aren't found. And BuiltByBit says it can't promise every placeholder is replaced. Placeholders help you find out who leaked a copy. They don't stop the copy from running.

ApproachReading the codeRunning a copied JARTracing a leak
ObfuscationSlower, still possibleWorksNo
License check in codePossibleBlocked until patched outOnly the key used
Download placeholdersPossibleWorksIf the marker survives
LatchNo plain code on diskNeeds a licensed serverMark per account

How Latch handles a Hytale plugin

Latch takes a different route: the code in the JAR the server owner receives is encrypted, and it only runs on servers whose owners you granted access to.

You upload your compiled plugin .jar. It needs manifest.json at its root with a Main field pointing to your entry class, and that class must be in the JAR:

{
  "Group": "com.acme",
  "Name": "MyPlugin",
  "Version": "1.0.0",
  "ServerVersion": "0.7.0-pre.2",
  "Main": "com.acme.Main"
}

What happens to each part, per the Hytale plugins docs:

  • Your .class files and resources are encrypted. Nothing stays readable on disk; the real code is decrypted only in the running server's memory.
  • manifest.json stays readable, so the server can still load the plugin.
  • .java and .map files never go into the package.

The result is a single .jar that goes in mods/, like any other plugin. Hytale plugins run entirely on the server, so players never receive plugin code. One thing to plan for: asset packs streamed to players (models, textures) can't be protected and shouldn't be in the code JAR. Keep them separate.

Four steps: upload the plugin JAR, Latch encrypts it, grant access to an account, the server owner installs it with their key

Who can run it

You decide which accounts can run your plugin. A server owner sends you their account ID (it looks like LA-7K2M-9QXD), you grant access from the script's Access tab, and the plugin shows up in their Library. They download it, put the .jar in mods/, and add their license key to a .env file in the server's root folder, next to mods/:

LATCH_LICENSE=LT-XXXX-XXXX-XXXX-XXXX

Hytale servers don't come with an env file, so they create one, or set LATCH_LICENSE as an environment variable instead. On start, the console shows that the plugin was verified and loaded.

Hytale server console showing the license key found, verified and the plugin loaded

If something is wrong, the server itself is never taken down:

  • A missing or invalid key: the plugin doesn't enable, the server starts normally, and the console says why.
  • Access revoked while running: only that plugin is shut down, through its normal shutdown.
  • License server unreachable: the plugin keeps running and retries; after 30 minutes without contact it stops.

When a copy leaks anyway

Encryption takes away the easy routes, and the leaks and key sharing docs cover what happens after that:

  • Copies are tied to an account. A package runs only with a key from the account that downloaded it. A JAR handed to someone else stops with a message saying so.
  • Keys can't be shared quietly. A key runs on one server at a time. If it's started on a second server, the plugin won't open there and a flag is raised on the script's page. On Pro and above you're also emailed.
  • Leaked copies are traceable. Every downloaded package carries an invisible mark linked to the account. Send the file in a support ticket and the team tells you which account's package it came from.
  • You can cut it off. Revoke that account's access and the plugin stops on all of their servers at the next verification. For a serious leak, ask the team to rotate the script's encryption key: every old package stops opening, and everyone with access downloads the new one.

What it doesn't do

No protection for code that runs on someone else's machine is 100%. The How protection works page says it plainly: this model stops unlicensed use and makes reaching the source impractical, but a determined person with full control of the server may still extract code from memory. What changes is the effort. Instead of opening a JAR in a decompiler, someone has to attack a running server, and when you spot abuse you can revoke access right away.

Latch also doesn't sell anything for you. You handle payments or deals on your own channel and grant access by account; there's no storefront and no commission.

Getting started

If you want to try it on one plugin, the Free plan covers one script with no card required, and every account gets one license key free, so you can run it on your own test server. The Hytale plugins guide walks through packaging and install, and pricing lists what the paid plans add.

All posts