Rewards and the editor¶
Everything a vote pays is built in game.
Nothing here needs a restart or a file. The editor writes rewards.yml as you
go, and you can read or hand-edit that file later if you prefer.
The six lists¶
| List | Paid when |
|---|---|
| Per-vote rewards | Every vote. Each reward rolls separately. |
| First vote | A player's very first vote, once, ever. |
| All sites in a day | Once a day, when a player has voted on every site you listed. |
| Milestones | At a vote total: once at 100, or every 10, your choice. |
| Vote party rewards | To everyone online when the party fills. |
| Top voter of the month | To last month's leader, when the month turns. |
There is a seventh list, the vote shop, which players buy from rather than being given.
What a reward is¶
A reward is commands, an item, or both, with four optional gates.
Commands run from console. Type them without a slash. These fill in:
| Placeholder | Becomes |
|---|---|
%player% |
The player's name |
%uuid% |
Their UUID |
%site% |
The site the vote came from |
%votes% |
Their new vote total |
%streak% |
Their daily streak |
%points% |
Their vote point balance |
Items are set by holding the item and clicking the item slot, or by dragging it onto the slot. What you hold is copied, never taken, and copied exactly: a renamed, enchanted, custom-model item from another plugin arrives in the player's inventory as the same item. If their inventory is full, it drops at their feet rather than vanishing.
The gates, all optional:
- Chance - a percentage. Three rewards at 100, 25 and 5 percent give everyone the first, a quarter of people the second, and one in twenty the third.
- Permission - only players who hold the node get it. This is how a donor tier gets more from the same vote.
- Site filter - only votes from one particular site. Useful when one site is worth more traffic than the others.
- Condition - a line of JavaScript that has to be true. See below.
Conditions¶
A condition is an expression, not a script. If it comes out true, the reward is paid.
votes >= 10 && streak >= 3
hour >= 18 || online < 5
site == "PlanetMinecraft"
month >= 20 && points < 100
Available to it: player, uuid, site, votes, streak, month,
points, online, hour, world.
Try one before you save it:
The answer comes back true or false with the values it used. A condition that does not parse fails closed - the reward is skipped, and the console says why once, not once per vote.
Scripted commands¶
A command that starts with js: is a script rather than a command line. It
gets the same variables plus an api object:
js: if (online > 10) api.broadcast("<gold>" + player + " voted during peak hours!")
js: api.dispatch("give " + player + " diamond " + Math.min(votes, 5))
js: if (api.hasPermission("rank.vip")) api.dispatch("eco give " + player + " 500")
api can dispatch(command), msg(text), broadcast(text),
hasPermission(node) and online(). It cannot touch files or the wider server,
on purpose.
Most servers never need this. It is here for the ones that do.
The vote party¶
A counter that fills as the whole server votes. When it reaches the number you set, everyone online is paid the party list and fireworks go up. The bar is shared across a network, so votes on any server push the same party.
It is a payout, not a minigame: there is no mob to fight and nothing to click. If you run a separate party plugin that spawns something, leave this off and point a party board at that plugin's counter instead, so players see one number rather than two.
Turn it on, set the number, or reset the counter from the editor's front
screen. Players check it with /vote party.
What players see¶
Each vote shows a title, plays a sound and lets off a small firework, all
configurable under effects in config.yml, and posts a broadcast you can
edit or switch off. Players who have not voted in a day get a clickable
reminder on a timer you set.