Skip to content

rewards.yml

pustinek edited this page Nov 12, 2019 · 10 revisions

Rewards are defined in the rewards.yml file. Rewards give you the option to specify different kind of rewards that player can get when they vote. This file is highly customizable and every option is described bellow.

Options

Option Description
type Possible options are ONETIME | MONTHLY | ONVOTE | ANYTIME
claimable Should the reward be claimed via GUI ... true -> player has to claim it via GUI, false -> given to player on vote

Rewards section

Options that can be used in the rewards section of a reward

Option type Description Example
money Give money to player money 3000
cmd Execute command cmd give {player.name} diamond 1
message Message player message You received reward {reward.name}
broadcast Broadcast message broadcast {player.name} recieved {reward.name} from voting !

Placeholders that can be used in the rewards section of a reward

Placeholder Description
{player} Player name
{player.uuid} Player UUID
{reward.id} ID of the reward
{reward.name} Name specified in gui section
{prefix} Prefix of the plugin specified in config.yml

Requirements section

Placeholders that can be used in the requirements section of a reward

Placeholder Description
{votes.total} Player required votes received in total
{votes.month} Player required votes received in the current month
{votes.server.total} Votes acquired by the whole server
{votes.server.month} Player required votes received in the current month
{votes.points} Player voting points (points are removed on reward claim)

1. Example
Player requires 100 votes that were obtained from the start of using this plugin and 20 votes obtained in the running month.

requirements: 
 - "{votes.total} 100"
 - "{votes.month} 20"

2. Example
For the player to get the reward the whole server has to receive 3000 votes this month and the player needs 20 monthly votes

requirements: 
 - "{votes.server.month} 3000"
 - "{votes.month} 20"

GUI section

Placeholders that can be used in the GUI section of a reward

integer

Placeholder Description Return Value
{requirements.month} Monthly required votes to receive the reward number
{requirements.total} Total required votes to receive the reward number
{requirements.server.month} Monthly server votes required to receive the reward number
{requirements.server.total} Total server votes required to receive the reward number
{requirements.points} Player voting points required number
{requirements.claimable} Are the requirements met and can be claimed ? string explaining
{votes.month} Player votes acquired this month number
{votes.total} Player votes acquired in total number
{votes.points} Player votes acquired in total number
{config.claimable} is the reward claimable as set in the file true|false
{config.type} type of rewards ONVOTE | MONTHLY | ONETIME

Examples of rewards:

1. Example - when player votes

rewards:
  basic_vote: #This line should be unique (id)
      enabled: true
      type: "ONVOTE"
      claimable: false
      requirements: []
      rewards:
        - "money 3000"
        - "message {player} You voted so you receive 2000 $"
      gui:
        name: "basic vote"
        material: DIAMOND
        enchanted: false
        lore:
          - "Vote on one of the websites to get the rewards"
          - "get the reward every time you vote"

2. Example - Monthly reward
Player will be able to claim the reward every month when he reaches 100 votes

  monthly_votes: #This line should be unique (id)
      enabled: true
      type: "MONTHLY"
      claimable: true
      requirements: 
        - "{votes.month} 100"
      rewards:
        - "money 10000"
        - "message {player} You claimed monthly reward so you receive 10 000 $"
      gui:
        name: "monthly_50_votes"
        material: DIAMOND
        enchanted: false
        lore:
          - "{votes.month}/{requirements.month} monthly votes"
          - "Vote on one of the websites to get the rewards"

Clone this wiki locally