Adding Rewards
Let's take a look at how to add rewards to your voucher!
Defining Reward Quantities
Firstly, we need to consider how many rewards should be given whilst redeeming a voucher. This could just be 1 reward or it could be anything like 5 rewards, 100 rewards, or even a million.
A common requirement for vouchers is that 1 of each reward is given, regardless of weighting. This is also possible.
To define the reward quantity, create a field named RewardsPerOpen
, an example is below:
As mentioned, this value can be set to the number of rewards to be given, or to the value of 'all' to ignore all weighting and give one of each reward in the voucher.
Adding the Rewards
To add rewards to your voucher, you will first need to add (or locate) the Rewards:
field.
This is a parent field, sub-fields will be included representing each individual reward.
To add a reward, we first need to create the reward ID. We find it helpful to use incrementing numbers to better keep track of all of the available rewards. However, this can realistically be anything.
Let's create a sample reward with ID 1 in our voucher file:
Now that we have a sample reward, let's look at each field in more detail:
Name
This is the name of the reward, players may be presented with this when previewing rewards through the official preview GUI.
Icon
Item
Amount
This is the quantity of item to be used for the icon, the value should be between 1 and 64, representing a valid minecraft Item Stack
Weight
If the RewardsPerOpen
field is not set to 'all', weight is an important aspect of the voucher. This will determine the chance of a user receiving that item when opening the voucher.
The best way to consider weight without a deeper understanding of statistics is like a raffle entry. Consider the weight value of a reward to be the number of raffle tickets entered into a big prize pool for that reward. Each rewards weight enters its associated number of raffle tickets. Then, when the voucher is used, a raffle ticket is pulled at random and the associated reward is provided. Evidently, the bigger the weight, the more likely a player is to receive that reward.
If you don't include the Weight
field in your reward, but RewardsPerOpen
is not set to 'all', the reward will automatically inherit the weight: 100
Commands
This is a String-List of all the commands to be executed when a player receives that reward. All commands are executed through the console.
You may use the built-in placeholder <playername> to represent the voucher user's name, or any PAPI placeholder in the commands list.
Message
This is the message sent to the user if that reward is given to them.
GUILore
This is the lore item of the reward icon shown within preview windows for the voucher.
You may use the placeholder <chance> to represent the percentage chance of acquiring that reward. This value is calculated based on the weight of all rewards, as well as the state of the RewardsPerOpen
field
Closing Notes
Last updated
Was this helpful?