Configuration
Main - Installation - Configuration
This plug-in is controlled through .json configuration files.
After you reload or restart your server, you will be provided with the following files:
- /plugins/PayRank/config.json
- /plugins/PayRank/payranks.json
- /plugins/PayRank/resources.json
Open these and and edit as you please. Below are details on each section of the .json files.
Some helpful links:
GSON - Bukkit's built-in JSON parsing library.
JSONLint - Tool for validating your JSON files.
Important Notes
- The order of each rank in the .json configuration also defines the progression order of the ranking system.
- The group value MUST match the same one found in group in your permissions.yml.
File: resources.json
This configuration file is used for the plug-in resource settings.
I won't go into detail on each entry here, but will give a quick overview on how to use it. An example from the file:
{ "messages": { "payrank.promote.completed.sender": "<player> has been promoted to the rank of: <rank>" }
payrank.promote.completed.sender is the name of the resource. DO NOT change this.
The next part is where you can change the text to be whatever you want. The <player> and <rank> are replaced with the player name and rank name accordingly.
These are not consistent through each resource. Many resources do not need them and thus do not parse them. The default configuration shows which placeholders can be used for that resource.
File: config.json
This configuration file is used for the plug-in global settings.
Default:
{ "chatFormattingEnabled": true, "loggingDebug": false }
Field descriptions:
chatFormattingEnabled | If you do not want the chat formatting to be applied set to false. |
loggingDebug | If you are having problems with the plug-in, set this to true and you should get additional information provided when using it. |
File: payranks.json
This configuration file is used to define each of the ranks you wish to use.
Template
The template portion of the configuration is used to allow you to define multiple format styles for when the text is placed into the game chat. You can assign a different template to each rank if you want.
Example of template:
{ "templates": [ { "name": "Template", "format": "<[time] [world] [prefix][player][suffix]> ", "time": "hh:mm", "worlds": [ { "name": "world", "displayName": "&e[World]&f" } ] } ] }
Field descriptions:
templates | Holds the list of template definitions. |
name | The name of the template. This is used below when defining a PayRank. |
format | The format to use for when text is placed into the chat. See chart below. |
time | The format to use for the time. |
worlds | Used to hold the list of worlds you want to have nicknamed. name is the name of the world. displayName is the name you want to have displayed in chat for that world. |
Format options:
You can move them anywhere, or just fully remove them entirely.
[time] | If provided, will be replaced with the current time using the time format above. |
[world] | The display name of the world as defined below. |
[prefix] | The text to place before the players name. See PayRank below. |
[player] | The players name. |
[suffix] | The text to place after the players name. See PayRank below. |
Pay Ranks
A PayRank is where we'll be defining the information used for mapping ranks to groups and their display information The prefix and suffix values can have colours and string elements in as seen below.
Example of template:
{ "payRanks": [ { "name": "Newbie", "group": "newbie", "prefix": "&a[Newbie]&f ", "suffix": "", "template": "Template", "price": 10, "experience": 10 } ] }
Field descriptions:
name | The name of the rank to be used for displaying in chat. |
group | The name of the group to match this rank to. Groups are defined in your Permissions handler. See your own documentation for how that is done. |
prefix | The text to place before the users name (as shown in template above). |
suffix | The text to place after the users name (as shown in template above). |
template | This is the name of the template as defined above that you want this rank to use for formatting. |
price | The money cost of the rank. |
experience | The experience cost of the rank. |
Full Example
For reference, here is an example of a working config.json:
{ "templates": [ { "name": "Template", "format": "<[time] [world] [prefix][player][suffix]> ", "time": "", "worlds": [ { "name": "world", "displayName": "&e[World]&f" } ] } ], "payRanks": [ { // For this rank, we're going to make it cost money only "name": "Newbie", "group": "newbie", "prefix": "&a[Newbie]&f ", "suffix": "", "template": "Template", "price": 10 }, { // For this rank, we're going to make it cost both xp AND money "name": "Member", "group": "member", "prefix": "&a[Member]&f ", "suffix": "", "template": "Template", "price": 20, "experience": 20 }, { // For this rank, we're going to make it cost xp only "name": "Dedicated", "group": "dedicated", "prefix": "&a[Dedicated]&f ", "suffix": "", "template": "Template", "experience": 20 }, { "name": "Professional", "group": "professional", "prefix": "&a[Professional]&f ", "suffix": "", "template": "Template", "price": 10 } ] }
i am getting a internal error useing this plugin i used the script from the full example and i want the group "dedicated" to be price so they buy it not experience so i replaced the experience with price i got the internal error. how can i fix this error?
If it costs only xp how do I change it so it costs money instead of xp?