V3 Custom Rewards - CraZyRc/WhackaMole GitHub Wiki
Newly introduced in V3.0.0: the Custom Rewards.
You can give players special rewards like enchanted items, a higher cash price, an effect status, send them a custom message, play an animation or Teleport them to another location! All highly customizable.
How does this work?
In the WhackaMole folder, you will find a file that's called rewards.yml. In this file you can set up your rewards system, Here's an example of how a reward looks:
Each reward can be configurated to only work with certain games and after hitting a certain points threshold. Then the actual Rewards are made out of RewardTypes with each their own Settings
RewardTypes
Each RewardType has their own Settings, but all of them share four settings, the Enabled, Threshold, RewardChance and UseInteract Setting.
The Enabled Settings enables/disables the reward. when disabled, the player won't be able to receive this reward type.
The Threshold Setting dictates how many moles the player MUST hit before being able to receive this reward.
The RewardChance Setting shows how big the chance of getting this reward is after hitting the minimum Threshold.
For example: RewardChance: 100 has a 100% chance of getting the reward. (A Setting of 100% ensures the player will always receive this reward.)
A RewardChance: 50 has a 50% chance of giving out the reward.
The UseInteract toggles whether you want the player to receive the animation before receiving the reward (when False, players will instantly get the reward without animation display).
There are 7 RewardTypes:
Animation: Spawns a customizable image made out of particles in front of the player.- Settings:
Animation: refering to which Animation file will be displayed (these files are stored in theanimationsfolder. More on this on the next page.Duration: How long the Animation will de displayed, this is in seconds (NOTE: the longer you display the Animation, the more lag it produces)
- Settings:
Item: Gives the player an Item- Settings:
Material: Which Item you wish to giveAmount: how many of the Item will be givenNBT: NBT data like enchantments, these are in JSON and are the same as in the/givecommand
- Settings:
Effect: Gives the player an Effect- Settings:
Effect: which vanilla effect you wish to give the playerDuration: how long the effect will lastAmplifier: standard: 1
- Settings:
Teleport: Teleports the player to a certain location (only works if the location is a safe teleport)- Settings:
World: which world you wish to send the player toRotation: Which direction the player will be facing after the teleportX,Y,Z: The coordinates
- Settings:
Currency: Gives the player an additional currency reward on top of the scored points reward- Settings:
Quantity: How much currency you wish to give the player
- Settings:
Message: Sends the player a customizable message- Settings:
MessageType: whether the message should be parsed as a raw text (String), or parsed as JSON (Json)Message: The actual message
- Settings:
Sound: Plays a specific sound for the player
Receiving a reward
Rewards are sent instantly in order of the Reward. the example Reward starts with the Animation Reward and then gives the Item reward.
All of the rewardTypes have a little animation to present the player with the reward before giving it to the player.
The player can right click these animations to receive their rewards instantly or wait 5 seconds and the animation will disappear and the reward will be given to the player Only the player who receives these rewards can interact with these animations.
The stars are the limit
You can create as many Rewards as you like, there really isn't a limit.