How to Start

Information of the plugin to work correctly on your server.

Requirements

1) Spigot

You need Spigot or Paper for the plugin to work. Don't use Craftbukkit.

2) PlaceholderAPI

This dependency is optional but extremely recommended. It will allow you to display the value of the created variables wherever you want. https://www.spigotmc.org/resources/placeholderapi.6245/

Installation

To install the plugin on your server just place the ServerVariables.jar file inside your plugins folder. Remember to use a Spigot/Paper server. Examples will be generated in the config.yml file, you can use them as a reference or delete them.

Config.yml

This is the main file where you can add new variables. To create a new variable just add a new configuration section in the config in the "variables" path.

Variables folder

You can also create more files inside the variables folder, where you can add new variables. This is a good practice to keep everything more organized. These variables should also be created under the "variables" path.

Remember to use a different name for each of the variables!

Your First Variable

Let's create our first variable. We want players on our server to have a custom currency called "Scorps", so they can use this money to buy special items.

Since each player will have their own amount of "Scorps", the variable should be of PLAYER type. Let's start adding that to the config, with the name of the variable.

variables:
  scorps:
    variable_type: PLAYER

Now, we know that this currency is a numerical value so we must select whether it will have decimals or not. In my case I don't want decimals, so the value type of the variable should be INTEGER.

variables:
  scorps:
    variable_type: PLAYER
    value_type: INTEGER

Finally, a very important detail is to set a default or initial value for the variable. All players will start with this amount of scorps.

variables:
  scorps:
    variable_type: PLAYER
    value_type: INTEGER
    initial_value: 5

In these simple steps you have created your first variable. How can I use it now? There are many ways you can. For example, if you have a GUI plugin that support click conditions (like CommandPanels), you can sell a custom item depending on the amount of scorps the player has. You just need to use the following PlaceholderAPI variable to get the player's scorps:

%servervariables_value_scorps%

To modify the scorps of the player you can use one of these three commands:

  • /svar set scorps <amount> <player>

  • /svar add scorps <amount> <player>

  • /svar reduce scorps <amount> <player>

Last updated