rewards
The prizes in rewards.yml, their chances, commands and messages.
rewards.yml lists the prizes. The winner of every raffle gets exactly
one, picked at random by chance.
Quick example
rewards:
flytime:
chance: 10%
display: "2 minutes of flytime"
commands:
- "voucher give %player% fly2min 1"
message: "&eYou have won &a2 minutes of flytime&e from the welcome raffle!"
powerkey:
chance: 10%
display: "a Power Key"
commands:
- "crate key give %player% power_key 1"
message: "&eYou have won a &aPOWER KEY&e from the welcome raffle!"
diamonds:
chance: 30%
display: "3 diamonds"
commands:
- "give %player% diamond 3"
message: "&eYou have won &a3 diamonds&e from the welcome raffle!"The key under rewards (flytime, powerkey) is the prize's id. It is
used by /welcomeraffle testreward and in console logs.
Reference
| Key | Type | Default | Notes |
|---|---|---|---|
chance | number | 1 | 10, 10% and 2.5 all work. Compared with the other prizes, see below. |
display | string | the id | The name used for %reward% in messages, for example the winner announcement. |
commands | list | Console commands to run, without the slash. | |
command | string | One command, as a shorter way to write commands. Both can be used together. | |
message | string | Sent to the winner. Leave it out to send you-won from messages.yml. |
How the chances work
Chances are compared with each other, they do not need to add up to 100, and there is always a prize. In the example above the three chances add up to 50, so:
| Prize | Chance | Real odds |
|---|---|---|
| flytime | 10% | 20% |
| powerkey | 10% | 20% |
| diamonds | 30% | 60% |
Run /welcomeraffle rewards to see the real odds of your own file. A
prize with a chance of 0 or less, or a chance that is not a number, is
skipped with a warning in console.
Placeholders
In commands and message:
| Token | Replaced with |
|---|---|
%player% | The winner's name |
%uuid% | The winner's UUID (commands only) |
%newcomer% | The new player the raffle was for |
%reward% | This prize's display name |
%prefix% | The prefix from messages.yml (message only) |
Colours and quotes
Messages accept everything messages.yml does: &e codes,
&#rrggbb hex and MiniMessage tags.
Always put a message in quotes. Without them, YAML reads a value that
starts with & as something else and the first word of your message
disappears:
message: &eYou won! # loses "You"
message: "&eYou won!" # worksThe layout from the original concept
This layout, with numbered entries and a single command, is read
just the same:
RaffleRewards:
'1':
flytime:
command: 'voucher give %player% fly2min 1'
chance: 10%
message: '&eYou have won &a2 minutes of flytime&e from the welcome raffle!'
'2':
powerkey:
command: 'crate key give %player% power_key 1'
chance: 10%
message: '&eYou have won a &aPOWER KEY &e from the welcome raffle!'Testing a prize
/welcomeraffle testreward <player> [prize]Gives the prize to an online player right now: its commands really run and the player gets its message and the win sound. Leave out the prize to roll a random one.
Plugin updates never touch rewards.yml, so prizes you delete stay
deleted.