You can now give rewards to top players. If the player is online, the reward is given instantly; if offline, they receive it when they reconnect. If you update the rewards file while they're offline, they will receive the updated reward.
Improvements:
Added a configurable message in lang.yml to translate "Loading" when a leaderboard is displayed.
Improved the detection of leaderboard resets, which sometimes failed to execute correctly.
Added a command to forcibly reset the top, useful for testing functionality. /xlb forcereset daily
Leaderboards now fetch fresh data from the cache when updated, so changes appear instantly in placeholders.
Added an option to save data of online players when the leaderboards update. This parses and saves placeholders of all connected players for instant updates. Recommended for servers with 50 - 100 players online. Not recommended for servers with 500+ players.
Code (YAML):
enabled: false
rewards:
kills:
top1:
top: 1
rewards:
- "command: give <player> diamond_sword
" - "message
: &7 &a
" - "center_message
: &6&lTOP &e
#<top> &6&lKILLS &f&l<amount>" - "message: &7 &d
" - "message
: &7You have received a diamond sword for staying in top!
" - "message
: &7 &a
" top2: top: 2 rewards: - "command
: give <player> iron_sword
" - "message
: &7 &a
" - "center_message
: &6&lTOP &e
#<top> &6&lKILLS &f&l<amount>" - "message: &7 &d
" - "message
: &7You have received a iron sword for staying in top!
" - "message
: &7 &a
" top3: top: 3 rewards: - "command
: give <player> stone_sword
" - "message
: &7 &a
" - "center_message
: &6&lTOP &e
#<top> &6&lKILLS &f&l<amount>" - "message: &7 &d
" - "message
: &7You have received a stone sword for staying in top!
" - "message
: &7 &a
"