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

DynamicKeepInv

Dynamically controls keepInventory based on day/night cycle, protection plugins, and death causes.

Загрузки
141
Подписчики
1
Обновлён
26 марта 2026 г.
Лицензия
Apache-2.0

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

DynamicKeepInv

Java Server License

DynamicKeepInv is a sophisticated plugin that revolutionizes how the keepInventory gamerule works on Minecraft servers. Instead of a simple global toggle, it dynamically controls inventory loss based on in-game time, death causes, territory protection, and economy.

It is designed for modern servers (1.20.4+) and features full native support for Folia region threading.


Why use DynamicKeepInv?

Vanilla Minecraft forces server administrators to choose between "Too Easy" (keepInventory true) or "Too Hard" (keepInventory false).

DynamicKeepInv bridges this gap by offering a configurable balance:

  • Day/Night Cycle: Players feel safe during the day but must survive the night without protection.
  • PvP vs PvE: Make PvP high-stakes (drop items) while keeping PvE casual (keep items), or vice-versa.
  • Economy Sink: Allow players to pay a fee to save their items upon death via an interactive GUI.
  • Land Integration: Respects claims from Lands and GriefPrevention (e.g., keep items in your own base).

Key Features

Time-Based Rules

  • Automatically enables keepInventory during the day.
  • Disables it at night based on configurable start and end ticks.
  • Plays sounds and sends titles when the status changes.

Advanced Death Rules

  • PvP vs PvE: Configure separate rules for Item Loss and XP Loss based on the killer.
  • By World: Set different rules for the Overworld, Nether, and End.
  • Permission Bypass: Players with dynamickeepinv.bypass never lose items.

Economy & Death GUI

  • Death Confirmation GUI: When a player dies, a GUI appears asking them to PAY to keep items or DROP them.
  • Auto-Pay: Players can toggle /dki autopay to automatically deduct the fee and skip the GUI.
  • Persistence: If a player disconnects while dead, their pending death is saved to a database and the GUI reopens upon rejoin.
  • (Requires Vault)

Player Statistics

  • Tracks death history for every player.
  • In-Game GUI: Run /dki stats to view:
    • Total Deaths, Saved Deaths, and Lost Deaths.
    • Money spent on keeping inventory.
    • Death cause breakdown (Day, Night, PvP, etc.).
  • PlaceholderAPI: Display these stats on scoreboards or chat.

Plugin Integrations

  • Lands: Configure rules for "Own Land", "Enemy Land", and "Wilderness".
  • GriefPrevention: Similar support for claims.
  • GravesX / AxGraves: If a player chooses to drop items (or cannot afford to pay), they are placed into a Grave instead of scattering on the ground.
  • Folia: 100% thread-safe region scheduling.

Logic Hierarchy

When a player dies, the plugin decides whether to keep or drop items based on this priority order (highest to lowest):

  1. Bypass Permission (dynamickeepinv.bypass)
    • If player has this permission, they always keep items.
  2. Claim Protection (Lands / GriefPrevention)
    • Is the player in their own claim? Use claim settings.
  3. Death Cause (PvP / PvE)
    • Did another player kill them? Use PvP settings.
  4. Wilderness Settings
    • If enabled, use specific settings for unclaimed land.
  5. Time-Based (Day / Night)
    • Fallback: Is it currently Day or Night?

Installation

  1. Download the latest JAR from the Releases page.
  2. Place it into your server's plugins/ folder.
  3. (Optional) Install Vault and an Economy plugin for paid features.
  4. Restart the server.

Commands & Permissions

Command Permission Description
/dki status dynamickeepinv.admin View current status (Time, World, Enabled).
/dki reload dynamickeepinv.admin Reload configuration and messages.
/dki toggle dynamickeepinv.admin Toggle the plugin on/off globally.
/dki stats [player] dynamickeepinv.stats View death statistics GUI.
/dki confirm dynamickeepinv.use Re-open the Death Confirmation GUI (if pending).
/dki autopay dynamickeepinv.use Toggle auto-payment mode.

Other Permissions:

  • dynamickeepinv.bypass: User always keeps inventory.
  • dynamickeepinv.stats.others: View other players' stats.

Configuration

A snippet of config.yml demonstrating the advanced economy mode:

advanced:
  enabled: true
  
  # Economy Settings
  economy:
    enabled: true
    cost: 100.0
    mode: "gui" # Options: charge-to-keep, charge-to-bypass, gui
    gui:
      timeout: 30 # Seconds to decide
      expire-time: 300 # Seconds to save data on disconnect

  # Death Cause Rules
  death-cause:
    enabled: true
    pvp:
      keep-items: false
      keep-xp: false
    pve:
      keep-items: true
      keep-xp: true

Placeholders

Requires PlaceholderAPI.

  • %dynamickeepinv_isday% - Returns true or false.
  • %dynamickeepinv_period% - Returns "Day" or "Night".
  • %dynamickeepinv_stats_save_rate% - Player's save percentage.
  • %dynamickeepinv_economy_cost% - Current death cost.

License

This project is licensed under the Apache 2.0 License.


Ченджлог

1.0.20.1Бета1.21.8, 1.21.9, 1.21.10 · 12 декабря 2025 г.

Big update

1.0.15Бета1.21.8, 1.21.9, 1.21.10 · 7 декабря 2025 г.

Changelog

[1.0.15] - 2025-12-07

Bug Fixes

  • Fixed economy payments not being tracked in stats database
  • Fixed potential SQLite connection crashes on server lag
  • Fixed /dki stats <player> not working for offline players

Improvements

  • Added async database writes for better Paper/Folia performance
  • Database operations no longer block main server thread
  • Graceful shutdown with async task completion

[1.0.14] - 2025-12-07

New Features

  • Added Player Stats GUI (/dki stats [player])
  • SQLite database for persistent death statistics
  • Track deaths saved, deaths lost, economy paid, death reasons
  • 45-slot inventory GUI with player head, progress bar, server stats
  • Added 8 new PlaceholderAPI placeholders for stats

PlaceholderAPI Stats Placeholders

  • %dynamickeepinv_stats_deaths_saved% - Total deaths saved
  • %dynamickeepinv_stats_deaths_lost% - Total deaths lost
  • %dynamickeepinv_stats_total_deaths% - Total deaths
  • %dynamickeepinv_stats_save_rate% - Save rate percentage
  • %dynamickeepinv_stats_economy_paid% - Total economy paid
  • %dynamickeepinv_stats_global_saved% - Server-wide deaths saved
  • %dynamickeepinv_stats_global_lost% - Server-wide deaths lost
  • %dynamickeepinv_stats_global_rate% - Server-wide save rate

Config Changes

  • Config version updated to 5
  • Added stats.enabled option

Permissions

  • dynamickeepinv.stats - View own stats
  • dynamickeepinv.stats.others - View other players' stats
1.0.13Релиз1.21.8, 1.21.9, 1.21.10 · 7 декабря 2025 г.

New most stable realease one ( i have tested it ngl)

[1.0.13] - 2025-12-04

New Features

  • Added PlaceholderAPI support with 14 placeholders
  • Placeholders: %dynamickeepinv_enabled%, %dynamickeepinv_keepinventory%, %dynamickeepinv_time%, %dynamickeepinv_isday%, %dynamickeepinv_isnight%, %dynamickeepinv_period%, and more
1.0.12Релиз1.21.8, 1.21.9, 1.21.10 · 3 декабря 2025 г.

[1.0.12] - 2025-12-03

New Features

  • Added use-death-cause option for wilderness settings
  • When enabled, wilderness deaths use death-cause (PvP/PvE) instead of fixed values
  • Allows Lands to control claimed areas while death-cause controls wilderness

Bug Fixes

  • Fixed death messages showing during daytime when keepInventory gamerule is already true
  • Plugin now skips advanced processing when gamerule handles everything

Config Changes

  • Config version updated to 4
  • Added wilderness.use-death-cause for Lands and GriefPrevention
1.0.11Релиз1.21.8, 1.21.9, 1.21.10 · 3 декабря 2025 г.

yea 4 versions and i found a stable one ngl.

[1.0.11] - 2025-12-03

  • Simplified config.yml (removed verbose comments)
  • Added wiki documentation
  • Config version updated to 3

[1.0.10] - 2025-12-03

Bug Fixes

  • Fixed death-cause not overriding wilderness settings
  • PvP/PvE now correctly overrides wilderness keep-items/keep-xp
  • Claimed areas (in-own-land, in-other-land) still have highest priority

Improvements

  • Updated priority order documentation in config
  • Clearer comments explaining how settings interact

[1.0.9] - 2025-12-03

New Features

  • Added per-world settings (world-settings section)
  • Added wilderness config for Lands/GriefPrevention
  • Added death message notifications (chat/action-bar)
  • Added custom gamerule change times (day-trigger/night-trigger)

Improvements

  • Advanced settings now disabled by default (safer for new users)
  • Nerfed Lands integration to avoid conflicts with Lands' built-in keepInventory
  • Added override-lands option for explicit control
  • Improved config comments explaining priority order
  • Fixed economy bypass death message reason

Config Changes

  • Config version updated to 2 (auto-migration supported)
  • Added gamerule-change section
  • Added death-message section
  • Added wilderness settings under protection plugins

[1.0.8] - 2025-12-02

  • Fixed thread-safety issues with protection hooks on Folia
  • Fixed item duplication bug when forcing inventory drops
  • Improved reload command to reinitialize economy and protection hooks
  • Fixed null gamerule handling that could crash the scheduler
1.0.7Релиз1.21.8, 1.21.9, 1.21.10 · 27 ноября 2025 г.
  • Add Lands plugin integration for land-based keep inventory
  • Add GriefPrevention plugin integration for claim-based settings
  • Separate settings for own/other land/claim
  • Safe API version mismatch handling (auto-disable on incompatible)
  • Downgrade to Java 17 for MC 1.20.4+ support
1.0.6Релиз1.21.8, 1.21.9, 1.21.10 · 27 ноября 2025 г.
  • Bug fixes
  • Added economy mode option (charge-to-keep / charge-to-bypass)
  • Fixed DeathListener event priority
  • Improved debug logging
  • Fixed bypass permission path to handle plugins that return null drops
  • Advanced day/night item and XP defaults now respect the base keep-inventory settings
  • Economy manager initialization is now thread-safe across Folia regions
1.0.3Бета1.21.8, 1.21.9, 1.21.10 · 20 ноября 2025 г.
  • Fixed a lot of bugs.
  • Added advanced configuration for inventory and XP control.
  • Added bypass permission for specific players.
  • Added Vault economy integration for paid keep inventory.
  • Added separate PvP and PvE death rules.
  • Added action bar and title notifications.
  • Added configurable sound effects.
  • Updated messages.yml with economy notifications.
  • Refactored broadcast to target specific worlds.
  • Added DeathListener for advanced logic with Folia support.

Warning: Advanced settings might not working yet.

Комментарии

Загружаем…