Reward Template
About 434 wordsAbout 1 min
Reward templates are used in conjunction with execution templates and contain reward content
Creating a Reward Template
You need to create a reward template before you can set the corresponding reward content in the execution template
In Game (Recommended)
I recommend you use the reward template editor menu in-game to set it up
You can open it by entering the command /pr reward editor
When setting up reward content, you need to Shift+Left Click on items in your own inventory
This allows you to quickly add items to the template as one of its rewards
Creating Files
You need to create files in the PixelReward/reward/reward/ folder
For file content and format, please refer to the default file toolreward.yml
Applicable Item Editors
PixelReward has a built-in item editor called ItemLite, suitable for creating static and small items
You can refer to ItemLite Default Configuration to add, modify or remove custom items
PixelReward also supports third-party dynamic items, such as custom items from MMOItems,
Each time you draw rewards, items with random attributes will be generated, and items will be distributed according to the player's personal MMOItems data, such as level and random item quality
This makes items randomized
You can check Compatible Plugins to see what item editor plugins can be adapted
Tips
If you use menu to set up
If you need dynamic items, do not directly Shift+Click to add the item to the template,
Instead, click the button to add a custom item, find the item editor plugin you need, then select and add the item from the item list!
This way, each time you draw a custom item, it will be randomized or given according to the player's attributes!
Item Property Attributes
You can set property attributes for items so that when players obtain them, the attribute settings are executed directly without giving the item.
This is typically used for giving money or executing commands, so that you can see the names of these rewards during the lottery, but won't receive the actual items.
Here's an example
reward:
money:
item: gold_ingot;1 # item_material;quantity
display: <#FFF700><shadow:#000FFF>Money # display_name
quality: rare # quality
probability: 0.2 # probability
properties:
one: # property_id, only for identification
type: give_money # property_type
amount: 2000 # property_parameter: attribute_valueHere are the currently available properties:
type: give_money # give_money
amount: 2026 # amount_of_moneytype: console_command # execute_console_command
command: tell %player% What can I say? # command, %player% variable is the player nameNote
Items with properties will only execute their properties and will not give players actual items.