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 hich means there is a 30% chance to execute heal Steve, and the command is delayed by 3 seconds.

Note: For now, placeholders are parsed before schedule and execution, meaning that they provide old information. Post-processing placeholders will come soon in the future!

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

Sound and chat messages

You may want to avoid the use of commands such as /tellraw or /playsound. In this case, Vouchers provide a few special rewards to fulfil your requirements!

Besides the aforementioned tags, there are a few extra

  • [message] to send single-line message without prefix

  • [sound] to play sound

  • [broadcast] to announce message/sound to all audiences on the server

For example:

[message] &aHello %player_name%
[sound] [broadcast] entity_firework_rocket_twinkle
[sound] entity.firework_rocket.twinkle
[chance=%player_exp%] [delay=1] &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/

Last updated