Paper plugin template
A complete Minecraft (Paper) plugin with SunLicense built in, to copy and build on: github.com/sunlicense-com/example-paper-plugin (MIT No Attribution: copy any of it without credit).
- Gradle + Shadow, with the Java SDK relocated into your own package
- The license key from
config.yml, or built in by BuiltByBit and Voxel Shop placeholders - A clear console message for every result code, keys masked
- A re-check every few hours, so revoking a leaked key reaches running servers
- An offline license fallback, and the plugin keeps running if SunLicense can't be reached (your choice)
- A sealed core in release builds: only a valid license runs your features, and modified copies are reported
- Tests against a stub server, a GitHub Actions workflow and an
AGENTS.mdthat tells AI assistants how to work in it without weakening the check
Get started
- In the dashboard, create a product and a policy (machines = servers), and an API key.
- Use the template on GitHub (Use this template), rename
com.example.myplugin, and put the key in~/.gradle/gradle.propertiesassunlicenseApiKey=slk_...(never in git). ./gradlew build, or./gradlew runServerfor a local Paper server with the plugin.- Put your features in
core/CoreFeatures.java: they start once the license is valid. - For the jar you sell:
./gradlew build -PsunlicenseProduct=<your product code>(with the CLI signed in) writesbuild/release/…jar, where the core is sealed so only a valid license runs it, the other classes are checked for tampering, and an ownership notice is logged at start-up (protection).
The template's README covers the details: selling on each store, the offline file, what server owners see.
Testing with your own license
Each test server takes one of the license's machine slots. Use a test license with a higher machine limit, or free slots from the license page.
