Back to blog

How to Protect Your Minecraft Plugin from Piracy, Leaks and Cracking

Updated Stephen, co-founder

Sell a plugin for long enough and you'll find it somewhere you didn't put it: a leak forum, a Discord "resources" channel, a server you know never bought it.

You can't make a Java plugin impossible to pirate. Anything that runs on someone else's server can, with enough effort, be changed to do what they want. What you can do is make the cheap, common kinds of piracy fail, so that a copy only works for the person who paid for it and getting around that takes real work.

This guide goes through how plugins actually get pirated, which protection stops each one, and what to set up before you launch.

The five ways plugins get pirated

In rough order of how often they happen:

  1. The jar gets reuploaded. A buyer posts the file to a leak site or a Discord server. No skill involved. If your plugin has no license check, every copy works.
  2. The key gets shared. Your plugin does have a license check, but the buyer posts their key alongside the jar. Without limits, one key works on every server.
  3. The license server gets faked. If your check accepts any response that says valid: true, someone points your license domain at their own machine (a one-line hosts file change) and answers "valid" to every key.
  4. A real response gets replayed. Slightly smarter: record one genuine "valid" response and play it back, so the check passes without contacting your server.
  5. The check gets cracked out. Someone decompiles the jar with a tool like Recaf, finds the license check, deletes it and rebuilds the jar.

Most pirated plugins are cases 1 and 2. Cases 3 and 4 are what separate a homemade check from a real one. Case 5 is the one you can slow down, but never fully prevent.

What stops each one

How it's pirated What stops it Effort for you
Jar reuploaded A license check, so a copy without a valid key won't run One dependency and one check
Key shared A limit on how many servers can use each key Set a default per plugin
Fake license server Signed responses, verified inside the plugin None, if your licensing system does it
Replayed response A fresh nonce in every request None, if your licensing system does it
Check cracked out Obfuscation, plus buyer tracing so you know whose copy leaked A build step and some keep rules

Each layer below covers one row.

1. A license check that can't be faked

A license check is a call your plugin makes on startup: "here's my key, am I allowed to run?" The interesting part is what happens to the answer.

If the answer is a plain true or false, anyone can impersonate your license server (case 3) or record an answer and replay it (case 4). That's why so many homemade systems only stop people who don't try.

A check worth having does two things on every request:

  • Signs the response. The license server signs its answer with a private RSA key that only it holds. Your plugin carries the matching public key and rejects any response whose signature doesn't verify. A fake server can't produce a valid signature, so faking the server stops working.
  • Uses a nonce. The plugin generates a random value for each request, and the server has to include that same value inside the signed response. A recorded response carries an old nonce, so the plugin rejects it.

This is exactly how MC License validates, and it's a single call in onEnable():

if (!MCLicense.validateKey(this, "yourPluginId")) {
    Bukkit.getPluginManager().disablePlugin(this);
    return;
}

The library creates mclicense.txt in your plugin's folder for the buyer's key, checks the signature and nonce, and logs the result to the console. The full walkthrough, including Gradle, Maven and shading, is in how to add a license key check to a Paper or Spigot plugin.

If you're building your own instead, signing and nonces are the minimum. We've written up everything else a homemade system needs.

2. Limits on every key

A signed check proves the key is real. It doesn't prove the person using it paid. Server limits close that gap: each key can only be active on a set number of servers at once, so a key posted in a Discord server stops working after the first one or two people use it.

A limit of one or two servers per license suits most plugins. That's enough for a production server and a test server, and anything beyond it stands out. For networks or customers with a real reason to need more, raise the limit on that one license rather than for everyone.

If one server keeps turning up on keys that aren't its own, you can blacklist its IP across your whole account. How to stop key sharing covers IP limits, blacklisting and spotting sharing in the dashboard.

3. Deliver keys automatically

This one isn't strictly protection, but without it the rest gets skipped. If every sale means generating a key and messaging the buyer by hand, you'll eventually be tempted to drop the check, or buyers will wait hours for a key and leave a bad review.

Each of the three main paid marketplaces handles this differently:

  • BuiltByBit inserts the buyer's key into the jar when they download it, using an external license key placeholder. The buyer never types anything.
  • Voxel Shop (Polymart) inserts the buyer's details into the download, and the purchase is verified with Voxel Shop the first time the plugin starts.
  • Tebex can't modify your jar, so the key is created when the payment completes and emailed to the buyer. Here's how Tebex license delivery works.

With MC License, all three create a managed license on your dashboard automatically. How automatic license delivery works goes through the details, including what automation still leaves to you, such as refunds.

SpigotMC is the exception. Its premium resource guidelines prohibit licensing systems, so keep any copy you sell there license-free. Where you sell decides what protection you can use.

4. Obfuscate, and know what it buys you

Licensing handles cases 1 to 4. Case 5, someone deleting the check, is a question of how long it takes them to find it.

Without obfuscation, your decompiled jar reads almost like your source code: class names, method names, a method called checkLicense. Obfuscation renames everything to meaningless names and strips out unused code, so the check is far harder to find and the plugin is harder to copy wholesale.

Be realistic about it. Obfuscation slows a determined person down. It doesn't stop them. What it changes is the economics: most leakers want a quick upload, and a jar that needs hours of reverse engineering is often not worth it to them.

ProGuard is free and works well for plugins once you add the right keep rules for Bukkit. Get them wrong and you'll break event handlers and config serialisation. Our ProGuard guide has a working Gradle setup and explains each rule. Paid obfuscators like Allatori and Zelix KlassMaster go further with string encryption and control-flow obfuscation, at a price.

5. Make every copy traceable

If a copy does leak, you want to know whose it was. Then you can revoke that key, and if it's a cracked build, you know which buyer to talk to.

BuiltByBit and Voxel Shop both replace placeholders in your jar at download time with details of the buyer, such as their user ID. BuiltByBit also adds a hash unique to that one download. Your license key ties a copy to a buyer too. Found your plugin on a leak site? walks through identifying the buyer, shutting the copy down and reporting it.

Don't punish the people who paid

Every layer above affects your paying customers too, so set each one up so they never notice it.

  • Never block the main thread. A license check that runs synchronously in onEnable() can stall server startup if the network is slow. Run it off the main thread with a timeout.
  • Separate "invalid" from "couldn't check". A check that came back and said no is a reason to disable. A timeout or DNS failure isn't proof of piracy, and treating it like one takes honest servers down whenever there's a network blip.
  • Set fair limits. One or two servers per license, raised for the buyers who ask, keeps support quiet.
  • Make failures readable. If the plugin disables itself, say so in the console and say why, so the server owner knows to check their key rather than open a bug report. MC License's library logs every pass and rejection for you.
  • Let buyers check their own key. A public license checker shows a buyer whether their key is valid, when it expires and how many servers are using it, without them opening a ticket.

What not to do

  • Don't hardcode a key or password into the jar. One decompile and it's public, along with every copy that uses it.
  • Don't add a "kill switch" that harms servers. Deleting files, crashing servers or granting yourself operator on pirated copies hurts the server owner, not the person who leaked it, and plugins that do it get treated as malware. Disabling your own plugin is enough.
  • Don't rely on obfuscation alone. A jar with no license check doesn't need cracking. It just needs uploading.
  • Don't collect more than you need. A license check needs a key and enough server details to enforce limits. Server owners notice when a plugin phones home with more.

Your protection checklist

Before launch

  • Add a signed, nonce-checked license check, run off the main thread
  • Set a default server limit for the plugin
  • Obfuscate the release build and test it on a real server
  • Connect your marketplace so keys are delivered automatically

When it's live

  • Watch for keys with more active servers than you'd expect
  • Raise limits for buyers with a genuine need, one license at a time
  • Point buyers at the license checker for their own status

When a copy leaks

  • Identify the buyer from placeholders or the key
  • Revoke the key and reissue one if the buyer wasn't at fault
  • Report the upload to the site and the marketplace

Getting set up

MC License covers the first three layers out of the box: signed and nonce-checked validation, server limits and IP blacklisting, and automatic key delivery on BuiltByBit, Voxel Shop and Tebex, all managed from one dashboard. Basic and Professional both start with a free trial, and no card is needed.

Create your free account →

Ready to protect your plugins?

Create a free account and get started in minutes.

Get started free