# Reward

Each reward is a command that will be executed when the player redeems a voucher. In each reward, you can define extra properties called **tags**

**List of tags:**

* `[player]` to run the command as the player who redeemed the voucher
* `[chance=<chance between 0.0-1.0>]` to set chance
* `[permission=<permission>]` to require permission
* `[delay=<seconds>]` to delay the execution of the command

It is possible to use multiple tags. They must be before the command.

Tags and the command also support PlaceholderAPI. For example:

`[chance=0.3] [delay=%player_level%] heal %player_name%`

Assume the player's name is Steve and his level is 3. After parsing placeholders, the reward becomes`[chance=0.3] [delay=3] heal Steve` which means there is 30% chance to execute `heal Steve`, and the command is delayed by 3 seconds.

**Note**: Currently, placeholders are replaced at **schedule.** As a result, information could be outdated at the time of execution.

If some rewards are not working properly, you can enable debug mode to inspect the error.

## Sound and chat messages

You might want to avoid the use of commands such as `/tellraw` or `/playsound`. In this case, Vouchers provide a few special tags:

* `[message]` to send single-line message (without prefix)
* `[sound]` to play sound
* `[broadcast]` to announce message/sound to all audiences on the server (combine with either `[message]`or `[sound]`)

```
[message] [broadcast] &aHello %player_name%
[sound] [broadcast] entity_firework_rocket_twinkle
[sound] entity.firework_rocket.twinkle
[chance=%player_exp%] [delay=1] [message] &aYou are reaching the next EXP level!
```

For sound, you can use either Bukkit names or resource paths (in case you have custom sounds in the resource pack)

* Link to all Bukkit sounds: <https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html>
* Minecraft sound paths: <https://misode.github.io/sounds/>

**Consider**: Message reward vs Voucher-specific use message

* Voucher-specific use message is a new feature available from version v1.1.3
* Both supports RGB color and PlaceholderAPI
* Both having no prefix
* Message reward is more powerful (permission, delay, chance)
* Voucher-specific use message could be reused (using YAML anchor and alias)
