Treasure Chests - File14/ProCosmetics GitHub Wiki
Treasure Chests
Treasure chests are a rewarding system that allows players to unlock cosmetics, earn coins, and receive custom rewards through an engaging chest-opening experience.
Players can obtain treasure chests by:
- Purchasing them with in-game coins
- Commands - Perfect for server stores, rank rewards, or vote rewards
- Custom integration with other plugins
Permissions
Treasure Chests can be purchased using permissions:
- Allow purchase of all treasure chests:
procosmetics.purchase.treasure_chest.* - Allow purchase of a specific treasure chest:
procosmetics.purchase.treasure_chest.<treasure_chest>
Creating platforms
Create a treasure chest platform using:
/pc platform create <platform_name><br>
The default platform is default_platform
Rarity chances
Rewards are distributed by rarity tiers:
- COMMON - Most frequent drops
- RARE - Moderately rare items
- LEGENDARY - Extremely rare and valuable items
Rarity weights work like a lottery: If weights are: common: 40, rare: 9, legendary: 1 Total weight = 50 (40 + 9 + 1), so:
- Common: 40/50 = 80% chance
- Rare: 9/50 = 18% chance
- Legendary: 1/50 = 2% chance
Duplicate handling
What happens when a player receives a cosmetic they already own? Modes:
- ALLOW - Give the duplicate anyway
- CONVERT_TO_COINS - Convert duplicate to coins
- PREVENT - Reroll until they get something they don't own