KeepInventoryShop | [1.20-1.21.4] icon

KeepInventoryShop | [1.20-1.21.4] -----

Buy Lives, Preserve Loot: KeepInventoryShop




New Features:
  • Console Command Support: Server owners can now execute KeepInventoryShop commands directly from the console. This includes buying, upgrading, adding, setting, or removing player lives without logging into the game.

    /keepinventory buy <player> <amount>
    /keepinventory upgrade <player> <amount>
    /keepinventory set <player> <amount>
    /keepinventory add <player> <amount>
    /keepinventory remove <player> <amount>
    /keepinventory lives <player>
    /keepinventory reload
  • Join Timer Toggle: Added configuration option use-join-timer allowing server owners to enable or disable the automatic granting of lives after a specified join duration.
----------, Mar 28, 2025

New Features:
  • Dynamic Permission-Based Limits:
    • Added flexible permissions to allow server owners to set custom life and upgraded life limits per player group or rank:
      • keepinventoryshop.limit.<number> – Set custom KeepInventory life limits.

      • keepinventoryshop.upgradelimit.<number> – Set custom KeepTotem upgraded life limits.
  • Improved Join Messages:
    • KeepInventory-related messages now appear slightly delayed after player login, preventing overlap with other server messages and improving readability.
Enhancements:
  • Updated Compatibility:
    • The plugin has been fully updated for Minecraft version 1.21.4.
  • Enhanced Particle Effects:
    • Improved visual feedback by increasing the particle density and clearly distinguishing purple and white swirl effects when upgraded lives are activated.
  • Simplified Dependencies:
    • Fully removed the dependency on ProtocolLib, simplifying setup and improving compatibility.
  • General Code Optimization:
    • Removed obsolete classes and code (CustomSwirlingTask), resulting in cleaner and more efficient performance.
Bug Fixes:
  • Memory Leak Resolved:
    • Fixed a memory leak by properly removing player data from memory upon leaving the server, significantly improving overall performance and stability.
----------, Mar 27, 2025

Enhancements:
  • Updated Compatibility: The plugin has been updated for Minecraft version 1.20.4.
Bug Fixes
  • Resolved issues with ProtocolLib particles not working properly when installed.
----------, Mar 22, 2024

Improvements:
  • Upgraded Lives Management: Enhanced the logic for managing upgraded lives. Upgraded lives are now correctly decremented before regular lives, ensuring a more intuitive survival experience for players. This update prevents upgraded lives from going into negatives and ensures proper notifications are sent to players upon consumption of an upgraded life.

  • Final Variables in Lambdas: Fixed an issue where local variables used in lambda expressions within event handlers were not effectively final. This technical improvement ensures compatibility with Java's lambda expression requirements, improving the stability and reliability of the plugin.
Bug Fixes:
  • Fixed PlaceholderAPI Registration: Addressed an issue where the PlaceholderAPI expansion was not being registered correctly, leading to placeholders not being replaced as expected.
  • Corrected Player Notifications: Adjusted player notification messages for clarity and consistency, ensuring players receive accurate feedback regarding their lives status.
----------, Mar 19, 2024

New Features:
  1. PlaceholderAPI Support: Integrated PlaceholderAPI into KeepInventoryShop, allowing you to display dynamic information about player lives and other stats directly on your server's user interface. Now, you can use custom placeholders to keep your players informed about their status.
  • %keepinventoryshop_lives%
  • %keepinventoryshop_upgradedlives%
Enhancements:

  • Updated Compatibility: The plugin has been updated for Minecraft version 1.20.2.
----------, Mar 8, 2024

New Features
  • Added soft dependency for ProtocolLib to enable totem animation when using an upgraded life.
    • If ProtocolLib is not installed, players will receive a particle and sound effect instead.
  • Added a notification for the join timer system that informs the player when they have received a life after the timer has ended.
Improvements
  • Optimized the performance of the plugin by streamlining the code and reducing redundancy.
  • Adjusted the WorldGuard flag listener to ensure compatibility and smoother integration.
Bug Fixes
  • Resolved issues with the join timer system not working correctly while the player is online.
  • Fixed minor bugs and inconsistencies in the code.
----------, May 8, 2023

Introducing:
KeepTotems


[​IMG]

In this update, I'm excited to introduce KeepTotems, an enhanced Keep Inventory system that grants players a new way to protect their items upon death. KeepTotems function similarly to Totems of Undying, but without the need of having a physical totem in your hand.​

KeepTotems:
  • Players can now upgrade a KeepInventory life to turn it into a KeepTotem life, which will be consumed upon near death to protect themselves.
  • The cost of upgrading KeepTotems can be configured by server administrators to maintain a balanced economy.
----------, May 5, 2023

  1. Updated isWorldGuardAvailable() method to check if WorldGuard is installed and enabled on the server.
  2. Updated isPlayerInRegion() method to only use WorldGuard if it is available, avoiding NoClassDefFoundError when WorldGuard is not installed.
  3. Corrected the onPlayerDeath event handler to properly decrement the remaining lives of a player and handle the KeepInventory functionality based on the player's remaining lives.
These changes ensure that the plugin works as expected, even if WorldGuard is not installed on the server.
----------, May 1, 2023

Commands: Updated `/keepinventory` (alias `/ki`):
  • `/keepinventory`: Shows your lives.
  • `/keepinventory buy <amount>`: Buy the specified amount of lives.
  • `/keepinventory set <player> <amount>`: Set lives for a player (OPcommand).
  • `/keepinventory add <player> <amount>`: Add lives for a player (OP command).
  • `/keepinventory remove <player> <amount>`: Remove lives for a player (OP command).
  • `/keepinventory help`: Show help for Keep Inventory commands.
  • `/keepinventory reload`: Reload config files (OP command).
  • `/keepinventory lives <player>`: Show the lives of a online player.

Permissions: Added new permissions:
  • `keepinventoryshop.set`: Allows the player to set lives for others. Default: OP.
  • `keepinventoryshop.add`: Allows the player to add lives for others. Default: OP.
  • `keepinventoryshop.remove`: Allows the player to remove lives for others. Default: OP.
  • `keepinventoryshop.view.others`: Allows the player to view lives of other players. Default: OP.
Updated existing permissions:
  • `keepinventoryshop.reload`: Allows the player to reload the Keep Inventory configuration. Default: OP.
Improved command autocompletion:
  • Added tab-completion suggestions for the available subcommands.
  • Added tab-completion suggestions for online players when using /keepinventory lives or /ki lives.
----------, May 1, 2023

I made several changes to the code today to make it compatible with WorldGuard and to achieve the desired behavior when using this plugin.
  1. Added a new method isWorldGuardEnabled() to check if WorldGuard is enabled on the server.
  2. Added a new method isPlayerInRegion(Player player, String regionId) that takes a player and a region ID as its input. This method checks whether the given player is inside the specified region or not. If the player is inside the region, it returns true, otherwise, it returns false. To do this, it uses the WorldGuard API to get the player's location, the RegionManager, and the ApplicableRegionSet, and iterates through the applicable regions to check if the region ID matches the input region ID.
  3. In the onPlayerDeath event handler, modified the code to first check if the player is inside the "keep_inventory_zone" region using the isPlayerInRegion method. Based on the player's remaining lives and their location (inside or outside the region), and set the appropriate behavior for keeping or dropping the inventory.
Here's a summary of how the plugin should work with WorldGuard now:

  • If a player dies inside the "keep_inventory_zone" region and has remaining lives, their inventory will be kept, and they will lose one life.
  • If a player dies inside the "keep_inventory_zone" region and has no remaining lives, their inventory will be dropped.
  • If a player dies outside the "keep_inventory_zone" region and has remaining lives, their inventory will be kept, and they will lose one life.
  • If a player dies outside the "keep_inventory_zone" region and has no remaining lives, their inventory will be dropped.
The plugin now checks for the player's location using WorldGuard and performs the desired action depending on their position and remaining lives.

I could not replicate the bug a player was having where it would clear a players inventory's in a region, so I could in no way check to see if it works. But hoping adding compatibility with WorldGuard fixes the issue.
----------, Apr 30, 2023

  1. Fixed issue where the join timer was only counting down when the player was offline. The timer now properly counts down for both offline and online players.
  2. Updated the mechanism for giving lives-on-join to players. Players can now claim lives after the join-timer has ended, regardless of whether they are online, offline, or reconnecting.
  3. Ensured that the join timer only restarts after a player has received their lives-on-join.
  4. Added proper handling of the lastLivesReceivedTimestamp to store the timestamp for each player when they last received lives.
  5. Fixed the config.yml reload for cost-per-life.
Noted Issue: Using WorldGuard with KeepInventoryShop drops players inventory's within a flagged area. I'll be addressing this issue for the next patch.
----------, Apr 28, 2023

Resource Information
Author:
----------
Total Downloads: 2,184
First Release: Apr 27, 2023
Last Update: Mar 28, 2025
Category: ---------------
All-Time Rating:
8 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings