Rewards

All of the relevant information regarding rewards configurations

Reward example:

  RandomMoney:
    Material: EMERALD #The material displayed as the reward
    Glow: false #If set to true the item is given an enchantment for the glow effect and has hide enchantments item flag automatically applied
    Name: '&a&l$1,000 - 50,000 Balance' #The text/name that is displayed on the reward item
    #Base64Texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTQ2N2E3YjlkNzZiYTZkMGZlZDc0MzYwMjUzM2ZjOThjODdhZjBjNjBmODBmMzhkYTc3NGY3YTAxYTIwOTNmYSJ9fX0=
    Amount: 1
    Enchantments: []
    Lores: []
    NBTtags: []
    GiveConfiguratedItem: false
    RandomNumberMin: 1000
    RandomNumberMax: 50000
    RandomNumberDecimals: true #This configuration makes it so the random number can be with a decimal, example: 12560,55
    PreviewName: "&a&l$1,000 - 50,000 Balance (x1)"
    PreviewLores:
    - "&7Receive a Random Amount"
    - "&7Between $1,000 and $50,000 in balance"
    - ""
    - "&7Chance: %percentage%%" #placeholders - %percentage% ; %chance%, read @PreviewLores explanation
    Commands:
    - eco give {player_name} {random_number}
    BroadcastMessagesToPlayers:
    - '&e&l{player_name} &f&lWas Lucky Enough to Win The &a&lMVP Rank Voucher'
    BlacklistedPerms: #Users with this/these permission/s won't be able to win this reward
    - Rank.MVP #Can be used so a user can't receive the same rank twice etc.
    MessagesToPlayer:
    - '&fCongradulations on Winning The Rarest Item in The Crate!'
    Permission: "Donator.Novice" #without this permission a player wont be able to receive this item
    Chance: 5

Material: The material displayed as the reward

Glow: If set to true the item is given an enchantment for the glow effect and has hide enchantments item flag automatically applied

Name: The text/name that is displayed on the reward item

Base64Texture: Custom player head textures can be applied to items which have it's material set to PLAYER_HEAD. You can find different head textures here: minecraft-heads.com. To find the skin texture, look for it on the bottom of the selected head page in the "Others:" section under "Value:"

Amount: defines the item's amount in a stack. The amount value will be seen in the reward preview page. Moreover, if GiveConfiguratedItem is set to true, the item given to the player will be of the set amount.

CustomModelData: used to apply custom model data values.

Enchantments: Enchantments can be added as a list section, following the format enchantment:level. List of proper enchantment names can be found here: https://docs.oc.tc/reference/enchantments under the "Bukkit Name" category. An example of applied enchantments following the format:

  Enchantments:
  - DURABILITY;10
  - DAMAGE_ALL;5
  - FIRE_ASPECT;2

Lores: the lore of the item

NBTtags: NBT tags for custom minecraft items, ignore this unless you know what you're doing.

GiveConfiguratedItem: if set to true, the configurated item is added to the players inventory upon win including executing any commands attached to the reward. Otherwise if set to false the user will only receive the rewards that are given via set commands.

RandomNumberMin: Used together with RandomNumberMax configuration to have the {random_number} placeholder be swapped for a randomly generated number (Used for commands). This configuration sets the minimum value that the random number generator can take. RandomNumberMax: Works the same as RandomNumberMin, only difference is it sets the maximum value for the random number generator to take into account. Placeholder {new_random_number} or %new_random_number% can be used when there are multiple commands in a reward and there's a need for a newly generated random number in between the set bounds. If you need new bounds for the second command it is suggested to use LinkedRewards feature, please refer to it for further information. RandomNumberDecimals: This configuration when set to true (by default is set to false) makes it so the random number can be with a decimal, example: 12560,55

PreviewName: Rewards custom name that is only showed in the crate's reward preview page. Useful for when GiveConfiguratedItem is set to true so the won item and preview item have different names.

PreviewLores: Rewards lore that is only showed in the crate's reward preview page. Useful for when GiveConfiguratedItem is set to true so the won item and preview item have different lore, for example when there's a need to showcase the reward's chance value. There currently are 2 placeholders for PreviewLores: %percentage% and %chance%. The placeholder %percentage% is used to display the actualy percentage chance to win the reward from the crate, while the %chance% placeholder will display the number you have set up in your "chance" configuration section.

Commands: Used to set up commands that are executed once the reward is won. Available placeholders: %player%, %player_name%, {random_number}, {new_random_number}

BroadcastMessagesToPlayers: Messages sent to all players when the player wins this specific reward. Available placeholder: %player_name%

MessagesToPlayer: Messages sent to the crate opener when the player wins this specific reward. Available placeholder: %player_name%

Permission: Without this permission a player wont be able to receive this item. Example value: "Rank.VIP"

BlacklistedPerms: Users with this/these permission(s) won't be able to win the reward. (The user will never see it rolling as a reward possibility) For example, can be used so a user doesn't receive the same rank twice.

Chance: A chance value to receive the reward. Can be either an integer or a decimal number.

The probability system is not one that is based on percentage chances but one that is based on a weight. This is because we put together all rewards into a single pool to pick a winner.

An analogy is to imagine a bag of tickets where the plugin will pick out a ticket and that represents the winning reward. Each reward has a "chance" number that represents the number of tickets. The more tickets you put in, the higher probability that it will get chosen and vice versa. The following is a more concrete example.

For this example, we chose convenient numbers where the summation adds up to 100. The total does not have to add up to 100.

    Reward A - Chance:50 
    Reward B - Chance:20
    Reward C - Chance:15
    Reward D - Chance:10
    Reward E - Chance:5

Each reward is calculated to a percentage based on its weight.

  • The total weight is 100 = (50 + 20 + 15 + 10 + 5).

  • Reward Percentage = (weight / total weight) * 100%.

    Reward A - Chance:50 # (50 / 100) * 100% = 50%
    Reward B - Chance:20 # (20 / 100) * 100% = 20%
    Reward C - Chance:15 # (15 / 100) * 100% = 15%
    Reward D - Chance:10 # (10 / 100) * 100% = 10%
    Reward E - Chance:5  # (5 / 100) * 100% = 5%

Hex Colors - Hex colors can be used anywhere within the plugin following the format #ffffff

Last updated