CyberLevels

Earning EXP

Let players earn EXP in various ways, such as by breaking blocks, killing mobs, or crafting items.

If you need to let players earn EXP their way and not by you triggering various commands to give them EXP, you can use the earn-exp.yml file. This file allows you to set up various ways for players to earn EXP based on their actions in the game.

What types of events can I use?

You can use a variety of events to trigger EXP earning. Here is every one of them:

  • Timed Giving: Give players EXP at regular intervals.
  • Dying: Players lose or gain EXP upon death.
  • Damage:
    • Damaging Players: Get EXP for damaging other players.
    • Damaging animals: Have your EXP reward increased for damaging animals.
    • Damaging Monsters: Get EXP for damaging monsters.
  • Killing:
    • Killing Players: Gain EXP when you kill another player.
    • Killing Animals: Set your EXP higher for killing animals.
    • Killing Monsters: Slain monsters to gain EXP.
  • Placing Blocks: Get EXP for placing blocks in the world.
  • Breaking Blocks: Players earn EXP for breaking blocks.
  • Consuming: Consume food to gain EXP.
  • Moving: Just move so you can earn EXP.
  • Crafting: Earn EXP for using crafting tables.
  • Brewing: Brew various potions to gain EXP.
  • Enchanting: Get EXP for using enchanting tables.
  • Fishing: Players earn EXP for catching fish.
  • Breeding: Breed animals for more EXP.
  • Chatting: Engage in chat to earn EXP.
  • Vanilla EXP gain: Use the vanilla EXP system to gain EXP.
  • Third party plugins:
    • RivalHarvesterHoes: Get EXP for using RivalHarvesterHoes.
    • RivalPickaxes: Mine using RivalPickaxes to gain EXP.

Enable your first event

For our little experiment, let's enable the Damaging Players event. Open the earn-exp.yml file and find the damaging-players section. Set enabled to true and adjust the exp range to your liking. For example:

earn-exp.yml
    specific-permissions:
      # These WILL stack on the ones above. Could be
      # used to reduce EXP loss for special users.
      enabled: false
      permissions:
      - 'permission.vip: 1, 2'

    damaging-players: 
      general: 
        enabled: false
        enabled: true
        # Earns between 2 and 5 exp (random integer).
        exp: 2, 5
        includes:
          enabled: false
          whitelist: false
          # Does not gain EXP for the following players.
          list:
          - MD_5
          - Kihsomray
      specific-players:
        # These WILL stack on the ones above.
        enabled: false
        players:
        - 'CroaBeast: 2, 4'
        - 'ThiccPickle: 3, 5'

    damaging-animals:
      general:
        enabled: false
        # Earns 1 exp.
        exp: 1
        includes:

How many EXP will players earn?

Players will earn a random amount of EXP between 2 and 5 each time they damage another player. You can adjust the range to fit your server's economy. In this example, I'll set it to a range of 7 and 15 EXP per trigger:

...
  exp: 2, 5
  exp: 7, 15

  # Don't forget you can also use a single number, like `exp: 10`, to give a fixed amount of EXP.
  # exp: 10
...

How to properly use includes?

Let's say you need to exclude certain players you cannot damage in order to earn EXP. We'll use Klema_LP and Kihsomray as examples. Let's pretend they're the server owners.

We don't want our players to hit our very important staff members! We'll leave the whitelist at false, meaning that the list below will be a blacklist. Here's how it looks like:

...
  includes:
    enabled: false
    enabled: true
    whitelist: false
    # Does not gain EXP for the following players.
    list:
    - MD_5
    - Kihsomray
    - Klema_LP
...

Now you know whitelist can take both true or false values. If it's true, the list will be a whitelist, meaning that only players in the list will be able to earn EXP. If it's false, the list will be a blacklist, meaning that players in the list will not be able to earn EXP.

I want to show you one more example. Let's say we don't like BreadWithBananas and want to only include him in the list of players you can earn EXP from damaging. We'll set the whitelist to true and add him to the list:

...
  includes:
    enabled: true
    whitelist: false
    whitelist: true
    # Only gains EXP for the following players.
    list:
    - BreadWithBananas
    - Kihsomray
    - Klema_LP
...

Stack EXP for specific players

If you also want to set more/less EXP for specific players in the list above, you can use the specific-players section. Here's how it looks like:

  specific-players:
    # These WILL stack on the ones above.
    enabled: false
    enabled: true
    players:
    - 'CroaBeast: 2, 4'
    - 'ThiccPickle: 3, 5'
    - 'BreadWithBananas: 5, 10'
    # Players will now earn extra EXP (from 5 to 10) when damaging BreadWithBananas.

And it's done! You have successfully enabled the Damaging Players event and set it up to your liking. Players will now earn EXP when they damage other players, and you can customize the amount of EXP earned based on various conditions.

Now it's your turn to explore other events and customize them to fit your server's needs. You can enable multiple events at once, and each event can have its own settings.


Conclusion

The earn-exp.yml file allows you to set up various ways for players to earn EXP based on their actions in the game. You can enable multiple events and customize them to fit your server's economy. The example above shows how to enable the Damaging Players event, but you can apply similar logic to other events as well.

In case you'll need help with the earn-exp.yml file, you can always ask us on our Discord server.

Last updated on