Перейти к содержимому
Mineforgian

Total XP Rewards

Track lifetime XP and trigger custom rewards! Includes a dynamic BossBar system.

Загрузки
69
Подписчики
1
Обновлён
8 декабря 2025 г.
Лицензия
MIT

Опубликован 2 декабря 2025 г.

A powerful and lightweight Paper plugin that tracks each player's lifetime XP and executes custom rewards when XP milestones are reached. Fully configurable, translation-ready, and built for modern Paper servers (1.21+).


✨ Features

  • Global Total XP Tracking 📈
    • Tracks XP from killing mobs, mining, and vanilla commands (/xp, /experience).
    • Never resets, even after death.
    • Async Caching: High-performance data handling prevents server lag.
  • BossBar Progress System 📊
    • Displays a customizable BossBar showing progress to the next rank.
    • Dynamic Mode: Auto-hides the bar when not gaining XP.
    • Rich Text support: Supports MiniMessage (Gradients, RGB) AND Legacy Color Codes (&a) simultaneously!
  • Reward System 🎁
    • Execute multiple commands when reaching a threshold.
    • Send custom broadcast messages.
    • Supports Minecraft Target Selectors in commands (e.g., @a, @p).
  • Full Customization 🛠️
    • PlaceholderAPI support.
    • Complete language control via lang.yml (including "Max Rank" text).
    • SQLite storage with automatic schema migration (external apps can read current_rank).

📥 Installation

  1. Download the latest release from the Releases page.
  2. Drop the .jar file into your server's plugins folder.
  3. Start the server to generate config files.
  4. Adjust config.yml and lang.yml to your liking.
  5. Restart or run:
    /txp reload
    

⚙️ Configuration

config.yml (example)

bossbar:
  enabled: true
  # Hybrid Support: Mix Legacy (&) and MiniMessage (<gradient>)!
  title: "&bCurrent Rank: &e%current_rank% &7| <gradient:blue:aqua>Next: %next_rank%</gradient> &7(&a%xp%&7/&c%required_xp%&7)"
  color: BLUE
  style: SOLID
  dynamic-mode: true # Bar appears on XP gain and hides after timeout
  timeout: 10

rewards:
  "1000":
    name: "<gradient:#2486B5:#3A816A>Novice</gradient>"
    commands:
      - "give %player% diamond 1"
      - "eco give %player% 250"
    broadcast: "&a%player% reached %threshold% XP (Novice)!"

  "50000":
    name: "Master"
    commands:
      - "give %player% netherite_ingot 1"
    broadcast: "&6%player% is now a Master!"

🧩 Placeholders

Available for use in Chat, Broadcasts, and BossBar:

Placeholder Description
%player% Player's name
%xp% Player's total lifetime XP
%current_rank% Name of the current rank (e.g. "Novice")
%next_rank% Name of the next rank (e.g. "Master")
%required_xp% XP required for the next rank
%threshold% The specific threshold reached (Rewards only)

🔧 Commands

Command Description Permission
/txp get <player> View a player’s total XP totalxp.view
/txp show Show your BossBar totalxp.use
/txp hide Hide your BossBar totalxp.use
/txp set <player> <amount> Set a player’s XP totalxp.admin
/txp reset <player> Reset player XP & history totalxp.admin
/txp reload Reload config & language totalxp.admin

💾 Storage

XP and reward history are stored via SQLite, located in: plugins/TotalXPRewards/database.db

External Access: The database now includes a current_rank and username column, making it easy to integrate with web leaderboards (e.g. Node.js apps).


🧩 Plugin Support

  • LuckPerms (for rank rewards)
  • Vault (for economy)
  • PlaceholderAPI (for extra placeholders)

The plugin does not depend on them but integrates automatically if installed.


🛡️ Disclaimer

This plugin was developed with the assistance of Google DeepMind's AI. All code and design decisions were reviewed and finalized manually.


📄 License

This project is licensed under the MIT License. You are free to use, modify, and contribute.


🤝 Contributing

Pull requests and feature suggestions are welcome! Feel free to open an issue if you encounter bugs or have ideas.


⭐ Support the Project

If you enjoy this plugin, consider leaving a star on GitHub — it helps a lot!

Ченджлог

1.0.2Релиз1.21.8, 1.21.9, 1.21.10 · 8 декабря 2025 г.

TotalXPRewards v1.0.2 - Optimization Update

🚀 Performance Optimizations

  • Async Caching System:
    • Player XP data is now loaded asynchronously when a player joins, preventing main-thread lag.
    • XP updates during gameplay are handled instantly in-memory.
    • Data is saved asynchronously on player quit or server shutdown.
  • Thread Safety: Database connections and write operations are now synchronized to ensure data integrity in asynchronous environments.

🎨 MiniMessage Support

  • Rich Text Formatting: Added support for MiniMessage formatting.
    • Use RGB colors: <#ff0000>Red
    • Use Gradients: <gradient:red:blue>Rainbow Text</gradient>
    • Use Click events and Hover text in broadcasts.
  • Backwards Compatibility: Standard legacy color codes (e.g., &a, &l) are still fully supported. You can mix both in your configuration!

💾 Database Improvements

  • External Access Support: Added username and current_rank columns to the SQLite database.
  • Automatic Migration: Existing databases are automatically updated on startup. This allows external apps (typ. Node.js) to easily query player ranks.

⚙️ Configuration Safety

  • Config Versioning: Added config-version tracking. The plugin now automatically detects old configurations and safely applies necessary updates.
  • Hybrid Color Support: Text formatting now supports both legacy color codes (&) and modern MiniMessage tags simultaneously (e.g., &bRank: <gradient:red:blue>...).
  • Configurable Max Rank: The "Max Rank Reached" text is now fully customizable in lang.yml via the max-rank key.

🔧 Refactoring

  • PlayerData Manager: Centralized data handling into a new [PlayerDataManager] class for cleaner and more maintainable code.
  • Cache-First Logic: Commands (/totalxp set/get) now utilize the cache for online players, reducing unnecessary database queries.
1.0.1Релиз1.21.8, 1.21.9, 1.21.10 · 7 декабря 2025 г.

🚀 New Features

BossBar System

  • Progress Tracking: A BossBar now displays the player's progress towards the next rank.
  • Dynamic Mode:
    • Enabled via bossbar.dynamic-mode: true in config.
    • When enabled, the BossBar only appears when a player gains XP and automatically hides after a configurable timeout (default 10s).
  • Toggle Commands: Players can manually control their BossBar visibility using:
    • /totalxp show
    • /totalxp hide
  • Full Customization: Title, Color, and Style are fully configurable.

Enhanced Placeholders

New placeholders are now available globally (in Chat, Broadcasts, and BossBar titles):

  • %current_rank% - Displays the name of the player's current rank (e.g., "Novice").
  • %next_rank% - Displays the name of the next achievable rank.
  • %required_xp% - Shows the total XP required to reach the next rank.
  • %xp% - Shows the player's current total XP.
  • %player% - Shows the player's name.

Rank Names

  • Custom Names: Rewards in [config.yml] now support a name: field (e.g., "Novice", "Master").
  • Auto-Migration: Existing configurations are automatically updated to include default rank names if missing.

Vanilla Integration

  • Target Selectors: Commands now support Minecraft target selectors (e.g., /totalxp get @a, /totalxp set @p 100).
  • Command Tracking: XP gained via vanilla commands (/xp or /experience) is now correctly tracked and added to the player's Total XP.

🛠️ Improvements & Refactoring

  • Configuration Template:
    • The default [config.yml] has been completely rewritten.
    • Improved layout, ASCII header, and detailed comments explaining every setting.
    • added list of all available placeholders directly in the file.
  • Language File:
    • Refactored for better readability and added missing messages for new commands.
  • Metrics: Integrated bStats metrics (ID 28208) for anonymous usage tracking.
  • Code Structure: Unified placeholder logic into the main plugin class to ensure consistency across all features.
1.0.0Релиз1.21.8, 1.21.9, 1.21.10 · 2 декабря 2025 г.

Changelog – Version 1.0.0

✨ Initial Release: Total XP Rewards

The first official release of TotalXPRewards is here! This version introduces a complete XP progression and reward system for Paper servers.


🚀 Features

XP Tracking

  • Tracks lifetime XP for every player (never resets, even after death).
  • Persistent storage using SQLite.

Reward System

  • Add any number of XP milestones.

  • Each milestone can execute:

    • Multiple commands
    • A broadcast message
  • Fully configurable via config.yml.

  • Compatible with all command-based plugins (LuckPerms, Vault, etc.).

Placeholder Support

  • Built-in placeholders:

    • %player%
    • %xp%
    • %threshold%
  • Optional support for PlaceholderAPI.

Language System

  • All messages stored in lang.yml
  • Designed for easy translation and full customization.

🔧 Commands Included

/txp get <player>      – View a player's XP  
/txp set <player> <n>  – Set XP  
/txp reset <player>    – Reset XP + reward history  
/txp reload            – Reload config + language  

🧱 Technical

  • Designed for Paper 1.21.10
  • Built with Java 21
  • Lightweight and optimized

🛡️ Notes

This plugin was developed with assistance from ChatGPT (OpenAI). All code was reviewed and finalized manually.

Комментарии

Загружаем…