Menu

1 / 4

How to add license keys to a Minecraft plugin in 10 minutes

DEV Community: java·Kasun Hapangama·10 days ago
#sQOdtBVf
#devtojava#devto#dev#server#license
Reading 0:00
15s threshold

Selling a premium plugin without license keys? Then every copy is the same jar. One buyer can hand it to a whole network, and when it turns up on a leak site you can't tell whose copy it was.

This tutorial adds licensing to a Paper plugin in about ten minutes. Every buyer gets their own key automatically when they download from BuiltByBit, a key works on a limited number of servers, and you can switch off one leaked copy without touching anyone else. It follows BuiltByBit's DRM guidance, so it never takes a paying customer's server down.

I build SunLicense , and I'll use it as the license server here (the free plan covers 3 products). The design works the same with any licensing service.

The design, in four rules

One key per buyer , written into the jar by the store. No keys to send by hand.

A server limit per key , for example two servers per purchase.

Check on startup, re-check every few hours. No phoning home every minute.

Only stop on a clear "no".…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.