Skip to content

Reward files

Ben edited this page May 29, 2023 · 20 revisions

How rewards work - In a more technical sense

Reward files are located in a folder called Rewards in the plugins folder. They are rather simple to use, but allow endless possibilities.

Basically, you put what kind of rewards you want in them (Like money, commands, items, and more). After that the reward file is complete and can be used where ever it needs to be. When using it you list the file name without the ".yml".

So the reward file "Test.yml" should be listed as "Test". When the reward is executed it checks all conditions (Chance, Permission, Online/Offline, World). If the conditions are met the reward file is executed.

You can have it delay when to give the file, so this means you could have one file add a user permssion and one that removes it x minutes later.

There is also things like Randomly pick a reward file, so when the reward file is executed it can randomly pick a reward with a fallback list (If chance is unlucky).

The possibilities are endless! You can see a good breakdown of the possibilities below.

Breakdown of Reward files

Please note in the actual reward file you can simply delete the lines of stuff you don't want, so just have the actual rewards you want (E.g. Just one line stating the money to give and that's it, no need to worry about other lines)

Requirements to give reward possibilities:

  • Permission
  • World
  • Chance
  • Online/Offline (Reward type)
  • Javascript (true return)
  • VaultGroup
  • RewardExpiration (Reward has to be claimed within a certain amount of time)
  • Server
  • LocationDistance (Be within a certain distance of a location)

Possible Rewards/Effects that can be defined:

  • Items (with random item amounts possible)
  • Money (with random money amounts possible)
  • Commands
  • Potion Effects
  • Title
  • BossBar (1.9+)
  • ActionBar
  • Sound
  • Particle Effect
  • Custom Message
  • Broadcast
  • Firework

Advanced:

  • Randomly pick a reward file to give on chance, Also option if chance is unlucky give fallback reward
  • Delay when to run reward file (useful for giving players permission, then removing x hours later)
  • Run reward file at specific time
  • Javascript: Give reward if expression is true or false
  • Javascripts: execute javascript
  • Choice Rewards
  • Javascript anywhere (in commands and such)
  • Priority System
  • SpecialChance
  • Repeat Rewards

Examples:

See ExampleBasic or ExampleAdvanced for examples on the above!