Premium Resource Placeholders & Identifiers - Historical

Applied By AnnaDev: Feb 11, 2018 at 6:19 PM

Premium Resource Placeholders & Identifiers

Premium Resource Placeholders

The ins and outs


Spigot placeholders are super useful anti-piracy variables, injected into your plugin upon download.
This means Spigot can track and observe unmodified premium plugins.

Now as you may or may not know, spigot injects it's own anti piracy using these variables, and it's used as an deterrent to inexperienced plugin leakers. The more experienced however, know that anything is crackable, and you should keep this in mind.


The nitty-gritty


The placeholders are as follows.
  • "%%__USER__%%"
    • The ID of the user downloading the plugin.
    • You can go to https://www.spigotmc.org/members/%%__USER__%%/ to find the user page.
  • "%%__RESOURCE__%%"
    • The ID of the resource being downloaded.
    • You can go to https://www.spigotmc.org/resources/%%__RESOURCE__%%/ to find the resource page.
  • "%%__NONCE__%%"
    • This is a unique ID for each and every single resource download. It is highly unlikely 2 downloads are going to have the same %%__NONCE__%.


How to use them


Using these placeholders is easy... They're simply replaced in a string. So when you compile and upload the following
Code (Java):
final String myUserString = "Welcome!"
    + "\nYour user ID is %%__USER__%%"
    + "\nThis resource ID is %%__RESOURCE__%%"
    + "\nAnd the unique download ID is %%__NONCE__%%";
Will get transformed and the various variables will be changed to the appropriate values.


This is wiki page!


This is an open wiki page, and everyone can feel free to edit it. Please add any additional/new placeholders to benefit everyone.