CyberLevels

Rewarding Players

Reward players for reaching certain levels or milestones and motivate them to keep playing.

To keep your players motivated, you can reward them for reaching certain levels or milestones. The CyberLevels plugin allows you to set up rewards that players can receive when they reach specific levels.

And the biggest advantage of CLV? Setting as many rewards as you want. Even 1000!

Let's break down the file

The rewards.yml file is where you define the rewards that players can receive. Let's see our newly generated file:

rewards.yml
rewards:
  name-of-reward:
    commands:
      - '[player] spawn'
      - '[console] eco give {player} 500'
    messages:
      - '[player] &dGood job!'
      - '[player] [actionbar] &7Level &d{level}'
      - '[player] [title] &dLevel Up!<n>You are now level {level}'
      - '[C] &d{player} &7has reached &d{level}&7!'
    sound:
      sound-effect: ''
      volume: 1
      pitch: 1
    levels: '1, 8'

  reward-2:
    commands:
      - '[player] spawn'
      - '[console] eco give {player} 700'
    messages:
      - '[player] &dGood job!'
      - '[player] [actionbar] &7Level &d{level}'
      - '[player] [title] &dLevel Up!<n>You are now level {level}'
      - '[C] &d{player} &7has reached &d{level}&7!'
    sound:
      sound-effect: ''
      volume: 1
      pitch: 1
    levels:
      - 9
      - 10
      - 11
      - 12
      - 13

How it works

Each reward has a specific name (e.g., name-of-reward). This helps you and the plugin identify the reward and properly apply it to the player.

You can only use one name per reward. Duplicate rewards will result in an error.

Each reward can have the following sections:

  • commands: A list of commands that will be executed when the player receives the reward.
    • Command Arguments:
      • [player]: Trigger command as the player.
      • [console]: Trigger command as the console.
  • messages: A list of messages that will be sent to the player when they receive the reward.
    • Message Arguments:
      • [player]: Send this message only to the player (without this argument, the message will be sent to everyone).
      • [actionbar]: Message displayed in the action bar.
      • [title]: Title message displayed on the screen (you can use <n> to create a subtitle).
      • [C]: Center the text in the chat.
      • {level}: The level the player has reached.
      • {player}: The name of the player who received the reward.
  • sound: The sound effect played when the player receives the reward.
    • Sound Arguments:
      • sound-effect: The sound effect to play (e.g., ENTITY_PLAYER_LEVELUP - please note that different server versions have different IDs and available sounds).
      • volume: The volume of the sound (0.0 to 1.0).
      • pitch: The pitch of the sound (0.0 to 2.0).
  • levels: A list of levels at which the reward will be given.

How you can format levels

You can format the levels section in two ways:

  • As a comma-separated string (e.g., '1, 8'): This means the reward will be given for levels 1 to 8.
  • As a list of integers. This means the reward will be given for each level specified in the list:
levels:
  - 9
  - 10
  - 11
  - 12
  - 13

Example Rewards

We've made a few examples of rewards to help you get started. You can copy and paste them into your rewards.yml file and modify them as needed.

1. Give players leather boots when they reach level 5, and a diamond sword when they reach level 10.

rewards:
  level-5:
    commands:
      - '[console] give {player} LEATHER_BOOTS' # This is an example command from something like CMI or EssentialsX.
    messages:
      - '[player] &dCongratulations! You have reached level {level} and received leather boots!'
    sound:
      sound-effect: 'ENTITY_PLAYER_LEVELUP'
      volume: 1
      pitch: 1
    levels: '5'

  level-10:
    commands:
      - '[console] give {player} DIAMOND_SWORD' # This is an example command from something like CMI or EssentialsX.
    messages:
      - '[player] &dCongratulations! You have reached level {level} and received a diamond sword!'
    sound:
      sound-effect: 'ENTITY_PLAYER_LEVELUP'
      volume: 1
      pitch: 1
    levels: '10'

2. Give players 500 coins from 1-10 levels, 1000 coins from 11-20 levels, and 1,500 coins from 21-25 levels.

rewards:
  level-1-10:
    commands:
      - '[console] eco give {player} 500'
    messages:
      - '[player] &dCongratulations! You have reached level {level} and received 500 coins!'
    sound:
      sound-effect: 'ENTITY_PLAYER_LEVELUP'
      volume: 1
      pitch: 1
    levels: '1, 10'

  level-11-20:
    commands:
      - '[console] eco give {player} 1000'
    messages:
      - '[player] &dCongratulations! You have reached level {level} and received 1000 coins!'
    sound:
      sound-effect: 'ENTITY_PLAYER_LEVELUP'
      volume: 1
      pitch: 1
    levels: '11, 20'

  level-21-25:
    commands:
      - '[console] eco give {player} 1500'
    messages:
      - '[player] &dCongratulations! You have reached level {level} and received 1500 coins!'
    sound:
      sound-effect: 'ENTITY_PLAYER_LEVELUP'
      volume: 1
      pitch: 1
    levels: '21, 25'

Now that you know how to set up rewards, you can create your own and customize them to fit your server's needs. You can also combine different commands, messages, and sounds to create unique rewards for your players.


Conclusion

We learned how to set up rewards for players when they reach certain levels or milestones. You can create as many rewards as you want, and customize them with commands, messages, sounds, and level requirements.

This will help keep your players motivated and engaged in your server.

Last updated on