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

Lifesteal Plugin

A fully customizable, production-grade Minecraft plugin that implements a complete lifesteal system with hearts, bans, revives, MySQL support, advanced crafting recipes, and full admin control — designed for scalable SMP servers.

Загрузки
16K
Подписчики
16
Обновлён
6 июля 2026 г.
Лицензия
All-Rights-Reserved

Опубликован 12 июня 2025 г.

Banner


LifestealSMP 🔪❤️

LifestealSMP is a highly configurable and fully featured Lifesteal plugin designed for modern Minecraft SMP servers.
It offers a complete hearts-based survival system, revive mechanics, advanced crafting, multi-language support, and full administrative control.


Discord invitation Github Invitation Operation in Minecraft 1.21+


🔧 Core Features

  • Heart System: Fully configurable heart loss and gain based on deaths, PvP, or environment.
  • Heart Items: Withdraw hearts into physical items that can be traded or consumed.
  • Heart Tiers: 5 tiers of heart items allow restoring from +1 up to +5 hearts.
  • Custom Crafting Recipes: Create your own crafting recipes for heart items and revive beacon.
  • Revive System: Revive banned players using special Revive Beacons via a chat-based confirmation system.
  • Rare Revive Beacon Recipe: Uses expensive materials like Netherite Blocks, Nether Stars, Wither Skulls, Enchanted Golden Apples & Totems.
  • Ban System: Players get automatically banned upon reaching 0 hearts.
  • Admin Control: Powerful /lifestealadmin system with full server control.
  • Command Hiding: Commands are hidden dynamically for players without permission.
  • Database Support: MySQL and SQLite database options for scalable player data.
  • Multi-Language Support: Fully translatable through external language files.
  • Configuration Reloading: Reload configuration and language files live using /reloadlifesteal.
  • Safe Bukkit API Design: Compatible with Bukkit, Spigot, Paper & Purpur.
  • Recipe viewer
  • Revenge system

🎯 Commands

Main Commands:

Command Usage Permission
/withdrawheart Withdraw hearts into item lifesteal.withdraw
/reloadlifesteal Reload configuration lifesteal.reload
/recipeview <heart|beacon|all> Display recipes lifesteal.recipeview
/lifestealadmin Admin main command lifesteal.admin

Admin Subcommands (/lifestealadmin)

Subcommand Description
set <player> <amount> Set hearts
add <player> <amount> Add hearts
remove <player> <amount> Remove hearts
giveheart <player> [tier] [amount] Give heart items (Tier 1-5)
revivebeacon <player> Give Revive Beacon
unban <player> Unban player
purgebans Unban everyone
setmax <amount> Set maximum hearts
resetall Reset hearts for all players
banlist List all banned players
reload Reload config & language

🎯 Permissions

Permission Description Default
lifesteal.admin Full admin access OP
lifesteal.reload Reload configurations OP
lifesteal.withdraw Withdraw hearts into items true
lifesteal.revive Use revive beacons true
lifesteal.bypasslimit Bypass max hearts limit OP

🔁 PlaceholderAPI Support

LifestealSMP includes built-in PlaceholderAPI expansion for dynamic integration with scoreboards, tab lists, nametags, holograms, and other placeholder-compatible systems. You can display player-specific data across your server in real-time.

Placeholder Description
%lifesteal_hearts% Shows the player’s current number of hearts (if online)
%lifesteal_maxhearts% Returns the configured max hearts a player can reach
%lifesteal_is_banned% Displays "true" or "false" based on whether the player is banned
%lifesteal_database_type% Shows the active database type, either "mysql" or "sqlite"
%lifesteal_lang% Displays the active language config file name
%lifesteal_startinghearts% Returns the configured default hearts for new players
%lifesteal_prefix% Inserts the plugin’s configured prefix string
%lifesteal_online% Displays "true" or "false" depending on player online status
%lifesteal_ban_reason% Displays a hardcoded reason ("Out of hearts") if the player is banned
%lifesteal_playername% Displays the player’s current username
%lifesteal_uuid% Returns the player’s UUID
%lifesteal_health% Shows the player’s current health points (HP)
%lifesteal_maxhealth% Shows the player’s current max health (HP)
%lifesteal_hearts_left% Shows how many hearts are left before hitting max hearts
%lifesteal_online_count% Displays the number of online players
%lifesteal_database_connected% Returns "true" or "false" depending on DB connection status

These placeholders allow server owners and developers to deeply customize their user experience, creating rich, dynamic interfaces that reflect each player's lifesteal status in real-time.


🚀 Supported Platforms


Available for multi platforms


  • ✅ Bukkit 26.1+
  • ✅ Spigot 26.1+
  • ✅ Paper 26.1+
  • ✅ Purpur 26.2+
  • ✅ MySQL & SQLite Databases

🔒 No NMS - No Version Lock

  • 100% version-independent.
  • No use of NMS, reflections, or unsafe internal APIs.
  • Fully safe for future Minecraft versions.

⚙ Planned Expansions

  • ✅ Economy integration
  • ✅ Custom revive options
  • ✅ More heart tier recipes
  • ✅ Crafting recipe GUI configuration
  • ✅ Expanded admin control panels

🔥 Perfect For:

  • ✅ Survival servers
  • ✅ Hardcore SMP
  • ✅ Lifesteal communities
  • ✅ Private or public SMP servers
  • ✅ Large network environments

LifestealSMP delivers a full Lifesteal SMP experience while remaining fully scalable, safe, and professional for any Minecraft server.


Made with ❤️ by MidnightZone


Have fun

Ченджлог

1.8.0Релиз26.1.1, 26.1.2, 26.2 · 6 июля 2026 г.
Area Change Details
Revenge Thread New revenge system added Added a full revenge-thread mechanic that binds a victim to the player who killed them for a configurable amount of time.
Revenge Thread Structured revenge state model Added a dedicated revenge thread object with validated victim ownership, killer ownership, start time, expiry time, and lifecycle helpers.
Revenge Thread Configurable revenge duration Added configurable revenge duration using revenge-thread.duration-seconds.
Revenge Thread Configurable revenge bonus damage Added a revenge-only damage multiplier against the killer using revenge-thread.damage-multiplier.
Revenge Thread Directional revenge tracking Added direction tracking toward the killer through action bar and optional compass behavior.
Revenge Thread Compass guidance Added optional compass tracking toward the revenge target.
Revenge Thread Action bar direction hints Added direction hints through %direction%-based action bar messaging.
Revenge Thread Localized direction labels Added configurable direction strings like north, south, north-east, nearby, and more.
Revenge Thread Close-range reveal Added a configurable reveal mechanic that briefly highlights the revenge target when nearby.
Revenge Thread Trap resistance Added configurable revenge trap resistance so victims take reduced trap-like damage from the player tied to the thread.
Revenge Thread Block trap toggle Added block-damage-enabled support to explicitly control whether generic environmental block damage participates in revenge resistance.
Revenge Thread Visible crimson thread visuals Added a particle thread between victim and target with configurable color, render distance, wave motion, update interval, and point density.
Revenge Thread Configurable revenge sounds Added configurable sounds for thread creation, completion, reveal, and break events.
Revenge Thread Creation feedback Added title, subtitle, message, and sound feedback when a revenge thread is created.
Revenge Thread Completion feedback Added title, subtitle, message, and sound feedback when revenge is successfully claimed.
Revenge Thread Break feedback Added dedicated thread-break messaging for expiration, logout, and invalidated revenge paths.
Revenge Thread Logout-aware handling Added configurable logout-breaking behavior using break-on-logout.
Revenge Thread Centralized manager flow Consolidated revenge behavior into a dedicated manager handling creation, cleanup, tracking, reveal, visuals, sounds, and resolution.
Revenge Thread Improved listener flow Reworked revenge event handling into cleaner, less fragile listener logic.
Revenge Thread Placeholder support Added placeholder support for revenge active state, revenge target, and time remaining.
Revenge Thread Better placeholder formatting Improved placeholder outputs with safer defaults, cleaner time formatting, and more stable values.
Revenge Thread Stronger validation Added stricter validation against invalid revenge state like self-targeting and impossible timing.
Console / Logging Colored console output fixed Reworked plugin status logging to use the proper console sender path instead of Java logger paths that printed raw § codes.
Console / Logging Styled console helpers added Added clearer helper methods for info, success, warning, and error console output.
Console / Logging Startup and shutdown logs cleaned Refined plugin lifecycle messaging to be more attractive, cleaner, and less repetitive.
Console / Logging Duplicate log noise reduced Reduced duplicated startup chatter from overlapping manager/bootstrap summaries.
Language / Localization Runtime language switching improved Strengthened language syncing and reload behavior so language changes apply more reliably without restart.
Language / Localization Language-aware reload path Reload flow now refreshes synced language data and active language manager content more cleanly.
Language / Localization Better missing-language fallback Added safer fallback behavior when a requested language file is missing.
Language / Localization Missing key handling retained Missing keys continue to be logged once instead of spamming endlessly.
Config Expanded config coverage Extended config support for revenge visuals, sounds, trap resistance, direction strings, and other new behavior.
Config More polished defaults Refined default fallback messages to be brighter, cleaner, and more visually appealing.
Config Wider gameplay message support Added or refined config-backed messages for deaths, revives, withdraws, reloads, indirect kills, inventory issues, and more.
Config Defensive parsing retained Kept safer fallback behavior for materials and similar config-driven values.
Database Styled database status logs Database connection and table messages now use the same polished console output approach.
Database Cleaner upsert-style persistence Refined SQLite/MySQL write behavior toward safer conflict/update handling.
Database Cleaner backend lifecycle Database setup/close flow remains structured and easier to maintain.
Commands / Admin Admin UX polished Admin command messages were redesigned to be clearer, flashier, and more consistent.
Commands / Admin Reload command improved Reload flow messaging and feedback were cleaned up and aligned with the upgraded style.
Commands / Admin Withdraw command improved /withdrawheart feedback now looks better and communicates failure/success more clearly.
Commands / Admin Permission-aware command visibility preserved Command hiding and execution blocking remain aligned with permission-aware visibility handling.
Gameplay Messages Full message beautification pass Refined fallback player-facing text across the plugin to be gaudy, colorful, polished, and more aesthetically appealing without being too noisy.
Gameplay Messages Consistent prefix styling Standardized the plugin prefix and message presentation style.
Gameplay Messages Cleaner success/warning/error tone Reworked message tone and category styling for clearer positive, warning, and negative feedback.
Sound Design More gameplay sound feedback Added or refined sound cues for heart usage, revive flow, reloads, rewards, denials, and key system events.
Sound Design Dedicated revenge sound layer Added revenge-specific sound moments for thread creation, reveal, completion, and breakage.
Recipes / UI Recipe system support retained Preserved custom recipe support while improving surrounding consistency and documentation readiness.
Recipes / UI Recipe/help support expanded Improved support for recipe-related help and translation coverage.
Code Quality General hardening pass Applied stronger null handling, validation, cleaner helper structure, and better cross-file consistency.
Code Quality Shared utility consistency improved Better aligned message, config, color, and manager usage across the codebase.
Code Quality Cross-system polish pass Refined behavior and presentation across commands, managers, listeners, placeholders, config, and console output.
1.7.0Релиз26.1.1, 26.1.2, 26.2 · 27 июня 2026 г.

New features

Change Description
Recipe preview system Added a full in-game recipe preview system for the plugin’s custom items. Players no longer need to rely on chat messages, screenshots, or outside documentation to understand how to craft important items. The feature introduces a dedicated GUI-based workflow for browsing and previewing custom recipes directly inside Minecraft.
/recipeview command Added a new /recipeview command as the entry point for the recipe preview system. It supports targeted previewing as well as overview browsing, making the feature usable both for players who already know what they want to inspect and for players who are just exploring available custom recipes.
Heart recipe preview Added a dedicated Heart recipe preview menu. This screen visually displays the configured 3×3 recipe layout, the crafted result, and supporting GUI information so players can immediately understand how the Heart item is made without needing external help.
Revive Beacon recipe preview Added a dedicated Revive Beacon recipe preview menu. Just like the Heart preview, it presents the full crafting layout and output item in a clean GUI, making one of the plugin’s most important late-game items much easier to understand and communicate to players.
Recipe overview menu Added an overview GUI accessible through /recipeview all. This acts as a recipe browser where players can see the available custom recipe categories in one place and open the exact recipe they want from there. It improves discoverability and makes the feature feel like a proper in-game interface instead of a command-only utility.
GUI navigation flow Added menu navigation between overview and detailed recipe previews, including a dedicated back button in recipe screens. Players can now move through the recipe system naturally instead of reopening commands every time they want to inspect another item.
Localized recipe GUI Added full language-system support for the recipe preview feature. GUI titles, labels, status text, instructions, back button text, ingredient labels, and error messages are now language-aware, allowing the feature to work properly across your translated language files instead of being locked to English.
Recipeview language namespace Added a dedicated recipeview.* language section to organize all recipe-browser-related messages and GUI text. This makes the translation structure much cleaner and gives every language file a clear place for recipe preview strings without scattering them across unrelated sections.
Styled recipe interface Added a more polished visual presentation for the recipe GUI, including custom-labeled interface items, a styled “Crafts Into” indicator, themed borders, and clearer UI separation between ingredients, output, and navigation. This makes the feature look intentional and server-ready instead of like a debug menu.
GUI sound feedback Added sound feedback for menu open, recipe selection, returning to the overview, and denied/error states. This improves the feel of the recipe interface and gives players clearer feedback while navigating the new system.
Animated menu borders Added a subtle animated border effect to the recipe menus. This gives the GUI a more premium feel and helps the feature stand out visually from a plain static inventory screen.
Runtime language switching Improved the plugin so language changes can be tested by changing the configured language and reloading, rather than requiring a full server restart. This makes translation work much easier and allows faster iteration when maintaining many language files.

Optimizations and internal improvements

Change Description
Recipe GUI now uses a cached text bundle RecipeViewCommand was refactored to load GUI-related language strings into a single structured text bundle instead of repeatedly calling the language manager for the same keys throughout menu construction. This reduces repeated lookup work, makes the command cleaner, and centralizes fallback behavior.
Missing language-key spam greatly reduced LangManager now tracks missing keys and logs each missing language key only once per load/reload cycle instead of spamming the console every time the key is requested. This is a major operational improvement, especially for your many-language setup where translation coverage may be incomplete during development.
Null/empty lang key warnings reduced The language manager also limits repeated warnings for null or empty language-key requests. This keeps the console cleaner and makes real problems easier to notice when debugging.
Replacement warning noise reduced Placeholder replacement validation inside LangManager now avoids repeatedly spamming the same malformed replacement-pair warning. This is small but useful when testing message formatting.
Language files now auto-sync on startup LifestealSMP now syncs bundled language files into the plugin data folder during startup. Missing keys are copied from the bundled resources into existing language files without wiping user translations. This makes updates much safer when new features introduce new language keys.
Selected language can be resynced on demand In addition to syncing all language files, the main plugin class now has support for syncing the selected language file path based on the configured language code. This improves maintainability and gives the plugin a cleaner language-update workflow.
Reload flow now refreshes recipes too ReloadCommand was upgraded so reload no longer just refreshes config/lang data. It now also unregisters and re-registers recipes after config reload, ensuring recipe changes immediately take effect without a full restart. This is a practical runtime optimization for development and live tweaking.
Reload flow now syncs language files before language reload On reload, language resources are now synchronized before the language manager is refreshed. That means newly added keys from bundled resources are available immediately after reload, which avoids stale-language states and reduces manual maintenance.
Correct reload permission handling Reload command permission handling was tightened so it uses the correct reload-oriented permission path instead of mixing responsibilities with broader admin permissions. This is a cleaner separation of access control and avoids permission-model ambiguity.
Recipe preview is fully read-only The GUI blocks top-inventory clicks, dangerous drag operations, shift-click behavior, hotbar swap abuse, and several inventory actions that could otherwise move items into or out of the preview. This prevents menu exploitation and makes the feature safer in production use.
Viewer-bound GUI ownership checks Recipe GUI instances are associated with the player who opened them, and interactions from mismatched viewers are cancelled. This is a safety hardening step that prevents odd behavior with shared inventory references or unexpected interaction paths.
Animation lifecycle cleanup The animated recipe GUI now starts and stops its scheduled animation tasks based on inventory open state, close events, and player quit events. This avoids leaving useless tasks running and prevents animation logic from leaking after the menu is no longer in use.
Back-button overwrite bug fixed The recipe preview animation originally reused the same slot as the back button, causing the arrow to visually disappear while its click handler still worked. The border slot list was corrected so animated border repainting no longer overwrites the back button slot. This fixes both visual integrity and UI trustworthiness.
Recipe preview logic tied to recipe manager definitions The recipe preview system reads from shared recipe definitions instead of acting like an unrelated mock GUI. This keeps visual previews aligned with the actual registered recipes and reduces drift between gameplay logic and presentation logic.
Command visibility model remains integrated The plugin’s command registration and permission visibility caching still integrate the new /recipeview command into the same command-hiding and permission-aware visibility model used elsewhere in the plugin. This keeps the new feature consistent with the overall command UX.
Multi-language maintenance improved Because the main plugin now syncs missing language keys and the language manager now falls back cleanly with reduced spam, you can translate files incrementally instead of needing every language file to be perfect immediately. This is a major maintainability improvement for a plugin with many translation targets.
1.6.0Релиз26.1.1, 26.1.2, 26.2 · 20 июня 2026 г.

Lifesteal SMP — Changelog


Important Notice

Change Description
PlaceholderAPI incompatibility on 26.2 This plugin version is currently not compatible with PlaceholderAPI when running on Minecraft 26.2 (server).

Changelog/Improvements

New features Description
Heart Refund system Deaths from non-player causes can now be handled more fairly, depending on server settings. (configurable)
Player-only heart loss option Servers can now make heart loss happen only when a player is killed by another player. (configurable)
Anti-Farm protection Repeatedly killing the same player in a short time no longer lets players farm hearts unfairly. (configurable)
Indirect kill support Indirect player-caused deaths are now handled more accurately, making heart rewards feel fairer. (configurable)
API support added LifestealSMP now includes API support, allowing better compatibility with supported addons and external features.

Small notice: All of the new features (except for API) can be enabled/disabled in the config.yml based on user's preferences

Change Description
Fairer death handling Non-combat and environmental deaths now behave more consistently.
Better PvP heart transfers Heart gain and heart loss during PvP is now more reliable and predictable.
Cleaner indirect kill rewards Players can now be rewarded more properly for certain indirect kills.
Anti-farm cooldown enforcement Repeated killer → victim kills inside the cooldown no longer transfer hearts.
Lifesteal ban checks improved Compatible systems can now detect whether a player is banned through the Lifesteal system more cleanly.
Change Description
Safer heart withdrawal Withdrawing a heart is now more reliable and less likely to fail unfairly.
Better inventory protection Players are less likely to lose a heart if their inventory is full.
Improved heart consumption Using heart items is now more consistent and less prone to accidental issues.
Better max-heart checks Heart items now behave more cleanly when a player is already near or at the limit.
Heart item support Compatible systems can now create and give heart items more cleanly.
Heart actions supported Supported integrations can now read, add, remove, and set player hearts more directly and reliably.
Change Description
More stable revive sessions Reviving players now works more smoothly and consistently.
Better revive timeout handling Expired revive attempts clean up more reliably.
Improved revive beacon usage Revive Beacons now behave more safely during interaction and chat flow.
Revives supported Supported integrations can now trigger player revival in a cleaner and more consistent way.
Revive Beacon support Compatible systems can now create, give, and recognize Revive Beacons more reliably.
1.5.0Релиз1.21.11, 26.1, 26.1.1 · 12 июня 2026 г.
Change Description
Removed noisy normal-case logging Stopped treating “no player row found” as an INFO event, because this is normal for first join / first lookup.
Debug-only missing-record logs Kept optional visibility by moving the message behind debug: true instead of always spamming console.
Cleaner DB reads MySQL#getHearts() and SQLite#getHearts() now return starting-hearts quietly when no record exists.
Reduced console clutter Makes real errors easier to notice because harmless first-time lookups no longer flood logs.
Safer connection checks Added isConnectionOpen() style checks before queries so bad connection states are logged clearly and separately.
Change Description
Custom-beacon-only detection The revive listener no longer treats any plain beacon as a revive beacon; it checks the custom beacon metadata.
Right-click + place support The beacon now works seamlessly whether the player right-clicks it or tries to place it. Placement is cancelled and revive mode starts instead.
Config-synced beacon metadata /lifestealadmin revivebeacon now builds the beacon from revive-beacon-crafting.display-name and revive-beacon-crafting.lore, matching listener checks exactly.
Session timeout handling Revive sessions now expire cleanly after the timeout instead of lingering awkwardly.
Duplicate-session prevention A player cannot start multiple revive sessions at once.
Safer target lookup Revive chat logic now resolves the target more carefully and handles invalid names more safely.
Guaranteed beacon consumption on success After a successful revive, the beacon is consumed correctly from the reviver’s main hand.
Listener cleanup Chat listener unregisters itself and cancels timeout tasks after completion, preventing stale revive sessions.
Change Description
Pre-check before consume The listener now checks current hearts before consuming the heart item.
No wasted item at max hearts If the player is already at the max-heart cap, the item is not consumed.
No partial-overflow loss If a tiered heart item would exceed max hearts, usage is blocked instead of silently consuming the item for no effective gain.
Clear user feedback Players now get a proper message when they cannot use a heart item due to the cap.
Cap respects bypass permission lifesteal.bypasslimit still allows exceeding the configured max as intended.
Change Description
Revive beacon creation centralized Added a dedicated buildReviveBeacon() path so admin-given beacons always match plugin expectations.
Inventory-full protection giveheart and revivebeacon now check leftovers from Inventory#addItem() instead of silently failing.
Safer player targeting Uses exact player lookup in the improved version for more reliable targeting.
More consistent prefixed messages Standardized more admin feedback through MessageUtils.sendWithPrefix().
Config-driven beacon metadata Removed hardcoded revive-beacon metadata drift by syncing item creation with config values.
Change Description
Main-hand beacon validation Before reviving, the plugin verifies the player still has the proper revive beacon in hand.
Safe session cleanup Cancels timeout tasks and unregisters the listener after the chat flow ends.
Safer chat handling Ignores unrelated chat, trims input, and handles blank target names safely.
Controlled revive flow The revive only proceeds when the target exists, is banned, and the reviver still holds the valid beacon.
Consumption after success Beacon removal occurs as part of the success path, so valid revives actually spend the item.
Change Description
Unified revive session start Moved the common revive-start behavior into one reusable method.
Placement interception BlockPlaceEvent support lets the beacon work even when the player tries placing it.
Metadata normalization Name/lore checks normalize formatting and stripped colors for more reliable matching.
Lore-aware validation The listener can validate both display name and lore, reducing accidental matches.
Permission-first handling Fails early with a clear message if the player lacks lifesteal.revive.
Change Description
Max-cap sanitation Keeps hearts from going negative and clamps to config max unless bypass permission exists.
Reliable health sync Applies max health immediately after heart changes so gameplay matches stored values.
At-least-one-heart safeguard Converts heart counts to health with a minimum of 2.0 health.
Cleaner heart adjustment path Centralizes add/remove behavior through adjustHearts().
Recommended sync-save path I recommended replacing async per-change saves with synchronous saves for heart updates to avoid race conditions under rapid events.
Modern max-health recommendation I recommended switching from player.setMaxHealth(...) to the attribute API for newer server compatibility.
Change Description
Verified kill transfer logic Confirmed PvP deaths give the killer +1 heart and remove -1 from the victim.
Non-PvP penalty preserved Confirmed non-player deaths only remove a heart if death-penalty-enabled is true.
Ban check after heart loss Victims are checked for zero hearts immediately after removal.
Cleaner structure recommendation I suggested splitting PvP and non-PvP death handling into dedicated helper methods for clarity.
Optional feedback messages Added a cleaner version that informs killer and victim about the heart transfer.
Change Description
Safer ban checks Verifies player validity and avoids duplicate bans.
Consistent kick-on-ban behavior Permanent ban flow bans and kicks with a constructed config-based message.
Cleaner unban path Prevents null/invalid unban attempts and logs successful unbans clearly.
Better naming/flow clarity Recommended a cleaner banSync() path and more direct checkBan() flow.
Compatibility with heart-loss flow Works correctly with the victim heart removal path so players reaching 0 hearts are punished immediately.
1.4.0Релиз1.21.6, 1.21.7, 1.21.8 · 28 июля 2025 г.

1. BanManager Improvements

Change Description
Fail-safe banning Checks player validity (online state, name) before banning.
Customizable ban reasons Prepares ban messages with clear reasons and placeholders.
Safer unbanning Prevents unban attempts for null/invalid players.
Consolidated log messages Unified logging with better error context.
Future-proofing Added potential for temporary bans (Date parameter left open).

2. HeartManager Improvements

Change Description
Centralized validation Sanitizes heart values (no negatives, max cap) via sanitize().
Safe scheduling Delays health update with Bukkit.runTask() only when necessary.
Single DB access per call Avoids redundant DB calls by reusing PlayerData.
Flexible heart updates addHearts() and removeHearts() now ensure health sync post-save.
Improved max health logic Always guarantees at least 1 heart (2.0 health).
Better null handling All methods safely return/exit when player or UUID is null.

3. RecipeManager Improvements

Change Description
Recipe validation Verifies shape (3x3 max), logs invalid formats.
Dynamic tiers Supports tier setting for Heart recipe.
Configurable outputs Item name and lore now pulled from config.
Safe removal Wraps Bukkit.removeRecipe() with checks.
Centralized registration registerAllRecipes() introduced.
Detailed error logs Detects missing/invalid materials per symbol.
Extensible design Ready for additional custom recipes.

Added new placeholders!

Placeholder Description
%lifesteal_playername% Returns the player’s name, or offline name if player is not online
%lifesteal_uuid% Returns the UUID of the player
%lifesteal_health% Shows the current health (HP) of the player (as an integer)
%lifesteal_maxhealth% Shows the maximum health (HP) of the player (as an integer)
%lifesteal_hearts_left% Displays how many hearts the player can still gain before reaching max
%lifesteal_online_count% Shows the number of currently online players
%lifesteal_database_connected% Displays "true" or "false" depending on whether the database is connected
1.3.0Релиз1.21.5, 1.21.6, 1.21.7 · 10 июля 2025 г.

ADDED PLACEHOLDERS (GOING ALONGSIDE MINOR IMPORVEMENTS)


Dimension Description Status
1. Resilience Architecture Commands and placeholder systems are built to continue functioning even under partial system failure (e.g., config loss, null plugin fields, SQL failure, PAPI missing). This is resilience by design, not exception handling afterthought.
2. Graceful Degradation Instead of crashing or halting features when a dependency is missing (like PlaceholderAPI or MySQL), your system downgrades functionality while maintaining UX continuity ("Offline", "ERR", fallback materials, default config values).
3. Dynamic Reflection Proxy for Optional API PlaceholderRegistrar uses dynamic reflection and proxying to register placeholders without compile-time binding to PAPI, supporting modular deployment and late binding. This is a decoupling architecture pattern.
4. Semantic Placeholder Decoding Layer The use of switch(identifier.toLowerCase()) with contextual logic (like online checks, config fallbacks) builds a semantic parser for identifiers. This design allows for scalable growth (e.g., %lifesteal_kills_today%, %lifesteal_revive_tokens%).
5. Config-Driven Control Layer All messages, materials, database types, and display elements are externalized to config, making the plugin highly customizable without code changes — a hallmark of production-tier design.
6. Contextual Tab Completion DSL AdminTabCompleter is essentially a domain-specific suggestion language for command trees. It parses arg index, subcommand semantics, and sender context to give tailored completions.
7. Game Rule-Aware Behavior Commands like /withdraw respect game logic constraints (e.g., minimum 1 heart), making the plugin exploit-resistant and gameplay-consistent. This isn't just a check — it enforces the design of the gamemode.
8. Structural Plugin Isolation Every subsystem (BanManager, HeartManager, ConfigManager, etc.) is accessed through clear, isolated interfaces, with plugin-safe guards. There is no deep structural coupling, supporting unit testability and future refactors.
9. Developer-Aware Feedback System Logger messages are structured, scoped ([PlaceholderAPI]), and precise — aiding devs with immediate traceability on user-side issues (like SQL faults or PAPI issues).
10. Deferred Execution Awareness SQL-heavy operations are guarded and designed to be lightweight in the main thread, preparing for future asynchronous conversion, especially for placeholders. ⚠️ Ready for async, but not async yet
11. Plugin Reload Safety All commands and placeholders support plugin.getConfigManager().reload() and react immediately to config changes, enabling hot-reload capability and zero-downtime admin operations.
12. Internal Type Normalization The use of .toLowerCase(Locale.ROOT) and guards like safeString(...) ensure locale-agnostic and NPE-safe string handling, which is internationalization best practice.
13. Minimal Surface Area Exposure The command classes expose only necessary logic; onCommand and utilities are not overexposed via public static or deep inheritance. This limits accidental misuse and encourages encapsulation.
14. Performance-Aware Inventory Handling Heart item creation (ItemBuilder) happens only if checks pass, and only 1 item is created and added, minimizing GC and lag.
15. Command Feedback Templating Every message supports {player}, {tier}, {amount} tokens — making it dynamic, parseable, and reusable, not hardcoded. This bridges with chat plugins and structured JSON systems.
16. Compatibility-Aware Versioning getVersion() in placeholders is dynamically retrieved from plugin metadata — no static literals — maintaining compatibility and correct display in admin panels.

CURRENTLY SUPPORTED PLACEHOLDERS!

Placeholder Purpose
%lifesteal_hearts% Player's current hearts (if online)
%lifesteal_maxhearts% Max hearts from config
%lifesteal_is_banned% Whether the player is banned
%lifesteal_database_type% Database type ("mysql"/"sqlite")
%lifesteal_lang% Active language config file
%lifesteal_startinghearts% Configured starting hearts
%lifesteal_prefix% Plugin prefix string
%lifesteal_online% Is player currently online
%lifesteal_ban_reason% (Hardcoded for now) "Out of hearts" if banned
1.2.0Релиз1.21.5, 1.21.6, 1.21.7 · 1 июля 2025 г.

SQL ENHANCEMENTS!!


Category Improvement Reason Result
Thread Safety & Singleton instance field is marked as volatile for thread safety. Ensures safe access to the plugin’s singleton instance across multiple threads. Prevents concurrent thread issues with inconsistent or conflicting access to the plugin instance.
Modularization & Readability Refactored onEnable() and onDisable() into smaller methods (init(), registerListeners(), etc.) Makes the code more modular, readable, and maintainable. Easier to manage and extend the plugin with minimal impact on the core plugin lifecycle.
Error Handling & Logging Enhanced error logging with detailed logs in critical areas. Provides clearer debugging information when issues arise. Better visibility in logs for identifying and troubleshooting issues.
Command Registration Commands now have permissions and tab completions (setTabCompleter(), setPermission()). Enhances command functionality and security. Commands are more user-friendly (with tab completions) and secure (with permissions).
Null Checks & Validation Added null checks for commands, listeners, and database connections. Prevents NullPointerException and ensures proper initialization before use. More robust and reliable behavior, with appropriate fallbacks or warnings.
Separation of Concerns Separated command and listener registration into individual methods. Improves maintainability by breaking down responsibilities into smaller, manageable chunks. Clearer organization and modularity in the code.
Resource Management Proper resource cleanup during plugin shutdown (safelyShutdown() method). Prevents memory leaks and ensures that resources are freed correctly when the plugin is disabled. Ensures the plugin shuts down cleanly and frees resources (e.g., database connections).
Logging Improvements Console messages now use Minecraft’s color formatting (& to §). Improves readability and visibility of logs for administrators. More visually appealing and easier-to-read logs for server admins.
SQL Enhancements Enhanced database interactions with prepared statements and better error handling. Prevents SQL injection and improves the security and reliability of database operations. More secure and stable SQL interactions.
SQL Connection Management Validates connection state before performing SQL operations. Ensures the plugin doesn't attempt to execute queries on invalid or closed connections. Prevents errors or unexpected behavior due to closed/stale database connections.
SQL Query Improvements Returns default fallback values if SQL queries fail or no data is found. Ensures the plugin continues working smoothly even if database interactions encounter issues or missing data. The plugin continues functioning even when database errors or missing data occur.
SQL Resource Management Properly closes database resources (PreparedStatement, ResultSet) using try-with-resources. Ensures resources are properly released, preventing memory leaks and improving performance. More efficient and cleaner database code.
Plugin Disable Enhancements Ensured safe shutdown of resources (database connections, recipes, etc.). Prevents lingering resources, file locks, or incomplete cleanup during the plugin's shutdown. A stable and reliable server experience with clean shutdown behavior.
1.1.0Релиз1.21.4, 1.21.5, 1.21.6 · 25 июня 2025 г.

🧠 Architecture & Design

  1. Centralized Utility APIs – MessageUtils, ColorUtils, ItemBuilder provide DRY, reusable patterns.

  2. Singleton-safe plugin access – consistent use of getInstance() for global plugin reference.

  3. Separation of concerns – clearly segmented managers (HeartManager, BanManager, etc.) avoid bloated main class.

  4. Graceful failover & shutdown – plugin disables on fatal error; database and recipes properly closed.

  5. Dynamic command delegation – uses executor-permission binding; fallback warnings for missing entries.


⚙️ Code Quality & Safety

  1. Null safety added – guards against null messages, lists, strings, ItemMeta, etc.

  2. Cloning of mutable objects – avoids returning internal ItemStack references directly.

  3. Input validation – amount clamped (1–64), tier limited (1–5), keys checked.

  4. Regex matching via Matcher.appendReplacement() – safe and efficient HEX color parsing.

  5. Safe config fallback – missing lang keys gracefully return default with warning.


📈 Performance Improvements

  1. Efficient string coloring – reused helper for batch lore coloring reduces overhead.

  2. Deferred meta setting – avoids redundant operations on ItemMeta.

  3. Command tab completer registered conditionally – avoids NPE if command is missing.


📜 Documentation & Readability

  1. Full JavaDocs added – method-level docs explain parameters, return values, and side effects.

  2. Consistent naming and formatting – fluent, descriptive method and variable names.

  3. Simplified logging interface – log(String) method wraps colored console output.


🚨 Error Handling & Logging

  1. Fallback logs for lang keys – warns when translation keys are missing.

  2. Structured exception logging – prints full stack trace on startup failure.

  3. Invalid hex codes skipped silently – prevents plugin crash from user config errors.


🧩 Extensibility Support

  1. Lore overloads and builder extensibility – builder pattern allows for chaining, expansion (e.g., enchantments).

  2. Formatted string retrieval in LangManager – supports runtime placeholders with String.format(...).

Комментарии

Загружаем…