For the complete documentation index, see llms.txt. This page is also available as Markdown.

๐Ÿš€Quick Start

Add licensing to an existing plugin in about five minutes, without changing how the plugin is built or shipped.

This is the fastest way to license a plugin. Your plugin stays an ordinary jar. You add one method call to onEnable, and it refuses to start without a valid license.

If you want the compiled code itself kept off the customer's disk, that is the other mode: see protected-plugins.md. You can start here and move later without reissuing any keys.

1. Create a product

In the dashboard, go to Products and create one. The Product ID you choose (for example my-plugin) is what your code will send. Nothing to upload yet.

2. Copy your server key

Go to Dashboard, Server key and copy the Ed25519 public key. Your plugin pins it so that nobody can point your customers at a fake license server and get a free "yes".

3. Drop in the client

Copy ObsidianLicense.java from the public API repository into your project and change the package to match. It is a single file with no dependencies beyond Gson, which Paper and Velocity already ship. There is nothing to add to your build file.

Prefer a dependency? The same code is on JitPack:

repositories { maven("https://jitpack.io") }
dependencies { implementation("com.github.ohAleee.obsidianlicense-api:core:v1.2.1") }

The example below is Paper. The client itself is platform-neutral, so the same call works on Velocity and in a plain Java application: see license check.

4. Call it on startup

public final class MyPlugin extends JavaPlugin {

    private ObsidianLicense.Result license;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        var cfg = getConfig();

        var client = new ObsidianLicense(
                cfg.getString("license.serverUrl"),
                cfg.getString("license.serverPublicKey"));

        try {
            license = client.check(
                    cfg.getString("license.key"),
                    "my-plugin",                                    // your Product ID
                    ObsidianLicense.machineId(getDataFolder().toPath()));
        } catch (ObsidianLicense.LicenseException e) {
            // Fail closed. The message is written for the customer, print it as-is.
            getLogger().severe("License check failed: " + e.getMessage());
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        getLogger().info("License OK");
        // your normal startup continues here
    }
}

And the config.yml your customers fill in:

Only key changes per customer. The other two are the same for everyone who buys that product, so ship them pre-filled.

5. Issue a key and test

In Licenses, create a license for your product. Paste it into a test server's config.yml and start Paper. The plugin enables, and the activation shows up in your dashboard's Access log with the IP and machine id.

Then try it with the key revoked: the plugin refuses to enable and prints the reason. That is the whole point.

What you now have

  • Seats. A license runs on a set number of machines, and customers free a seat themselves at /portal when they migrate servers.

  • A kill switch. Revoke a key after a refund or a leak and it stops working.

  • Expiry, for subscriptions and time-limited deals.

  • Tiers and entitlements, so one build can sell as Basic and Premium. See tiers-and-entitlements.md.

  • Several jars under one key, if your product is a lobby plugin plus a game plugin. See multiple-jars.md.

  • A full access log of every attempt, allowed or denied.

Next steps

โœ…License Checkโฌ‡๏ธDownloading the Jar๐Ÿ›’Marketplace Automation

Last updated