-
Notifications
You must be signed in to change notification settings - Fork 1
Statistics.md
The plugin tracks detailed statistics for each player and includes an achievement system with XP rewards.
chests-opened:
total: 47
common: 25
rare: 18
legendary: 4How it works:
- Increments when player opens chest
- Separated by tier
- Persistent across sessions
legendary-items-found: 3Counts:
- Dragon Slayer Sword
- Master Pickaxe
- Titan Axe
- Void Shovel
- Storm Hammer
- Guardian Bow
- Wisdom Book
- Phoenix Feather
- Poseidon's Trident
Does NOT count:
- Items from
/getlegendaryitems - Summoner Apples
guardians-killed: 12Counts:
- Any mob spawned as chest guardian
- Must be killed by player (direct damage)
summoner-apples-used: 2Increments when:
- Player consumes Summoner Apple
- Chest spawns successfully
current-xp: 5500Gained from:
- Opening chests (100-500 XP per tier)
- Unlocking achievements
- Killing guardians (50 XP each)
- Using abilities
Permission: None (all players)
Output:
━━━━━━━ Your Statistics ━━━━━━━
Chests Opened: 47
├─ Common: 25
├─ Rare: 18
└─ Legendary: 4
Legendary Items Found: 3
Guardians Killed: 12
Summoner Apples Used: 2
Total XP: 5,500
Achievements: 8/15 unlocked
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Aliases: /chesttop, /chesttop10
Permission: None
Output:
Top 10 Chest Hunters
1. Player1 - 156 chests
2. Player2 - 142 chests
3. Player3 - 98 chests
4. Player4 - 87 chests
5. Player5 - 76 chests
6. Player6 - 65 chests
7. Player7 - 54 chests
8. Player8 - 43 chests
9. Player9 - 32 chests
10. Player10 - 28 chests
Your rank: #4 (87 chests)
Ranking based on: Total chests opened
Players unlock achievements by completing specific tasks. Each achievement grants XP.
Task: Open your first chest
XP Reward: 100
Unlocks: Automatically when opening any chest
achievements:
first-chest:
unlocked: true
unlocked-at: "2026-02-03T15:30:00Z"
xp-reward: 100Task: Open 10 chests (any tier)
XP Reward: 500
Requirement: 10 total chests
Task: Open 5 Rare chests
XP Reward: 300
Requirement: 5 rare chests
Task: Open 50 chests (any tier)
XP Reward: 1000
Requirement: 50 total chests
Task: Open your first Legendary chest
XP Reward: 2000
Requirement: 1 legendary chest
Task: Find 5 different legendary items
XP Reward: 3000
Requirement: 5 unique legendary items
Task: Kill 10 guardians
XP Reward: 1500
Requirement: 10 guardian kills
Task: Kill 50 guardians
XP Reward: 5000
Requirement: 50 guardian kills
Task: Use 3 Summoner Apples
XP Reward: 800
Requirement: 3 apples consumed
Task: Open 100 chests
XP Reward: 10000
Requirement: 100 total chests
Task: Open 10 Legendary chests
XP Reward: 15000
Requirement: 10 legendary chests
Task: Find all 9 legendary items
XP Reward: 20000
Requirement: All legendary items found
Task: Open a chest within 30 seconds of spawn
XP Reward: 5000
Special: Requires being online when chest spawns
Task: Unlock all other achievements
XP Reward: 50000
Special: Meta-achievement
Task: Open at least 1 chest every day for 7 days
XP Reward: 10000
Special: Streak-based
When unlocking achievement:
Chat message:
━━━━━━━━━━━━━━━━━━━━━━━━━
🎉 Achievement Unlocked! 🎉
⭐ Chest Master
Open 50 chests
+1000 XP
━━━━━━━━━━━━━━━━━━━━━━━━━
Title notification:
🎉 Achievement!
⭐ Chest Master
Broadcast (if enabled):
🎉 Player1 unlocked achievement: Chest Master!
Sound: Level up sound + firework effects
| Action | XP Reward |
|---|---|
| Open Common Chest | 100 XP |
| Open Rare Chest | 300 XP |
| Open Legendary Chest | 500 XP |
| Kill Guardian | 50 XP |
| Use Summoner Apple | 200 XP |
| Unlock Achievement | Varies |
Example progression:
Player opens:
- 10 Common chests = 1,000 XP
- 5 Rare chests = 1,500 XP
- 2 Legendary chests = 1,000 XP
- Kills 8 guardians = 400 XP
Unlocks:
- First Chest = 100 XP
- Treasure Hunter = 500 XP
- Rare Collector = 300 XP
- Guardian Slayer = 1,500 XP
Total XP: 6,300 XP
/plugins/SpawnChestPlugin/statistics.yml
players:
uuid-here:
name: "Player1"
chests-opened:
total: 47
common: 25
rare: 18
legendary: 4
legendary-items-found: 3
guardians-killed: 12
summoner-apples-used: 2
current-xp: 5500
achievements:
first-chest:
unlocked: true
unlocked-at: "2026-02-03T15:30:00Z"
xp-reward: 100
treasure-hunter:
unlocked: true
unlocked-at: "2026-02-03T16:45:00Z"
xp-reward: 500
# ... other achievements
last-seen: "2026-02-03T20:00:00Z"
another-uuid:
# ... another player/chestconfig get statistics.players.<uuid>
Manual method:
- Stop server
- Edit
statistics.yml - Remove player entry
- Start server
No command yet - feature request!
- Statistics save every 5 minutes
- Save on player logout
- Save on server shutdown
- UUID-based (survives name changes)
- Cross-session tracking
- Backup on save
- Async database operations
- No lag from stat updates
- Queue system for high-load
statistics:
enabled: trueCommand: /togglefeature statistics
When disabled:
- Stats don't increment
- Achievements don't unlock
-
/mystatsshows "disabled" - Existing stats preserved
statistics:
achievements:
enabled: true
list:
first-chest:
xp-reward: 100
treasure-hunter:
xp-reward: 500
# ... configure eachModify XP rewards:
first-chest:
xp-reward: 250 # Increased from 100features:
broadcasts:
achievement-announcement: trueWhen true:
- Server sees when players unlock achievements
When false:
- Only player sees notification
@EventHandler
public void onChestOpen(PlayerOpenChestEvent event) {
Player player = event.getPlayer();
String tier = event.getTier();
// Custom logic here
}@EventHandler
public void onAchievement(AchievementUnlockEvent event) {
Player player = event.getPlayer();
String achievement = event.getAchievementId();
int xp = event.getXPReward();
// Custom logic here
}/achievements
Achievement Progress
First Chest complete
Treasure Hunter - 7/10 chests
Rare Collector complete
Chest Master - 47/50 chests
Legendary Finder complete
Legendary Collector - 3/5 items
Guardian Slayer complete
Guardian Destroyer - 12/50 guardians
Apple Enthusiast - 2/3 apples
Century Club - 47/100 chests
Progress: 8/15 unlocked (53%)
/leaderboard chests
/leaderboard xp
/leaderboard guardians
/leaderboard legendary
- Announce top players weekly
- Give rewards for leaderboard positions
- Host achievement races
# For competitive servers (high rewards)
treasure-hunter:
xp-reward: 1000
# For casual servers (normal rewards)
treasure-hunter:
xp-reward: 500"First player to unlock 'Chest Master'
gets $10,000 in-game currency!"
- UUID (required for Minecraft)
- Username (for display)
- Statistics (gameplay data)
- Timestamps
Players can request deletion:
- Stop server
- Remove UUID entry from
statistics.yml - Start server
Admins can export player data:
- Open
statistics.yml - Find player UUID
- Copy section
Check:
-
statistics.ymlfile permissions (read/write) - Disk space available
- Console for errors
Check:
- Requirements met:
/mystats - Achievements enabled in config
- Statistics system enabled
Check:
- At least 1 player opened chest
- Statistics system enabled
- File
statistics.ymlexists
Check:
- Statistics enabled
- Achievement XP configured
- Check
/mystatsafter action