This page shows how to integrate MC License into your plugin.
pluginId
and the license key
. The pluginId is a unique identifier for your plugin, and the license key is the key that the user has set in the mclicense.txt
file in your plugin’s folder (the library will create this file).
You’ll need the pluginId
for the validate function. To find it, head to the plugin on your dashboard and copy the random string of characters from the URL. It’ll look something like this: 6733f37754da3d7d26bbb9ad
.
To validate a license in your plugin, simply add the following code snippet to your onEnable
:
validateKey
function returns a Boolean. In the above code snippet, if the key is invalid, the plugin will be disabled. If the key is valid, the plugin will continue to load.