🎡 Rarity, Weights & Chances
Last updated
Last updated
Rewards and rarities uses Weights to define their probability (roll chance).
Weight can be any value and will affect the roll chances of all rewards/rarities.
You can see the roll chance for rewards in editor and also via .
Rarities is a good way to split your rewards by "cateogories" where each rarity has it's own roll chance to make certain rewards even more rare or common.
When there are rewards with different rarities in a crate, a rarity is choosen first. Then, reward is choosen based on selected rarity.
To edit or create new rarity, go to config.yml
-> Rewards -> Rarities. You will see a few default rarities there. Feel free to remove or edit them.
You must have at least one rarity available for the plugin to load and work.
Roll chance is determined: <weight> / <sum of weights> = <roll chance>%
Example. You have total 3 rewards in a crate:
Dirt. Weight: 50
Apple. Weight: 10
Gold Ingot. Weight: 2
Their sum of weights is 62 (50 + 10 + 2).
Roll chance for each reward is determined as stated above:
Dirt: 50 / 62 = ~0.8
(80%)
Apple: 10 / 62 = ~0.17
(17%)
Gold Ingot: = 2 / 62 ~0.03
(3%)
The sum of final values is 1.0 (100%). So you can use any value as a weight it will scale properly.
If you want to use direct chance values for your rewards or rarities, the sum of weights of all rarities or crate's rewards must be exactly 100:
Dirt. Weight: 80
Apple. Weight: 15
Gold Ingot. Weight: 5
The sum of rewards above is 100, so their roll chances are the same as weight values.
If your rewards have diffirent rarities, roll chance may not be equal to the weight value.