-
Notifications
You must be signed in to change notification settings - Fork 7
features top players
Config Plugins edited this page Sep 3, 2026
·
3 revisions
Three commands access the balance ranking, all backed by TopCacheService:
| Command | Permission | Description |
|---|---|---|
/vaultop [page] |
vault.top |
Quick alias command (default true) |
/vault top [p] |
vault.eco.top |
Admin sub-command |
/eco top [p] |
vault.eco.top |
Sub-command within /eco (OP default) |
Never calculates the top on the player event thread. Instead:
Bukkit Async Scheduler (every refresh_seconds)
↓
build() → snapshotBalances() for each currencyId
sorted DESC by balance
Bukkit.getOfflinePlayer(uuid) to resolve names
↓
CachedTop { List<TopEntry>, rankByUuid: Map<UUID,Integer> }
↓
ConcurrentHashMap caches.put(currencyId, cached)
top:
refresh_seconds: 300 # recalculate every 5 min (300 s)
change_threshold: 0 # invalidate cache only if |Δ| > threshold-
refresh_seconds— period of therunTaskTimerAsynchronously. Minimum value1s(internallyMath.max(1L, x)). -
change_threshold: 0— aggressive invalidation on every admin op (/eco set/give/take/reset).
TopCacheService.invalidateAll() → clears all currencies
TopCacheService.invalidate(currencyId) → clears one specific currency
Both trigger an async refreshAll() in the background.
Each ranking entry:
class TopEntry {
int rank; // 1-based
UUID uuid;
String name; // OfflinePlayer.getName() or UUID[:8]
double balance; // raw unformatted value
}PlaceholderAPI (if installed) reads directly from TopCacheService:
| Placeholder | Returns |
|---|---|
%vault_top% |
Multi-line formatted top 10 |
%vault_top_<n>% |
Full line for position n |
%vault_top_name_<n>% |
Player name at position n |
%vault_top_amount_<n>% |
Formatted balance of player at position n |
Commands return 10 results per page. Limit calculation is done in each command handler; if page ≤ 0 page 1 is assumed.
The rankByUuid cache (Map UUID → rank) enables O(1) lookups for "what rank does player X hold?" via getRankNumber(currencyId, uuid).
Vault Economy v2.1.0 · Compatible with Spigot 1.8.8 – 1.21.x
📦 Modrinth ·
💬 Discord ·
Java 17 (legacy) · Java 21 (modern)
Documentation generated on 2026-09-03 · Vault Project Team
- 🏠 Home
- 🚀 First Install
- 🧑🏫 Getting Started
- ❓ Basic FAQ
- 📋 Complete Command List
- 🛡️ Complete Permission List
- ⚙️ config.yml Reference
- 🌐 Supported Languages
- 🆕 Modrinth Updates
- 💰 Player-to-Player Payments
- 🏦 Bank System
- 💵 Physical Notes
- 💸 Loans
- 📜 Transaction History
- 📊 Top Players
- ⏸️ Offline Payments
- 💳 Charges / Payment Requests
- 🔔 Discord Webhook
- 🛠️ Installation Errors
- 🚫 Players Can't Pay
- 🧨 Balances Wiped on Restart
- 📉 Bank Doesn't Pay Interest
- 🧾 Invalid / Expired Notes
- 🩺 Complete Step-by-Step Troubleshooting
- Java API
- 📜 Skript
- 🧰 Contribute · Dual Maven Build