Compatibility
Minecraft: Java Edition
26.3
26.2
26.1.2
1.21.1
1.20.1
Platforms
Supported environments
Server-side
Client and server
Links
Tags
Creators
Details
Licensed GPL-3.0-or-later
Published 6 months ago
Updated 3 days ago
Keep But Penalty
Keep your inventory. Pay a fair price for death.
Keep But Penalty is a lightweight, zero-dependency multi-loader mod for Fabric, Forge, and NeoForge that keeps player inventories on death without mutating the world's keepInventory gamerule—while replacing tedious corpse runs with fair, configurable experience, durability, hunger, and progressive respawn debuff penalties.
Highlights
- Death-Scoped Keep Inventory: Temporarily projects
keepInventory = truevia a reentrantThreadLocalonly whileServerPlayer.dieandServerPlayer.restoreFromexecute. Your world's realkeepInventorygamerule is never altered. - Exact Experience Penalty: Defaults to keeping 75% of total experience (25% lost). Computes
experienceLevel,experienceProgress, andtotalExperiencedirectly with exact vanilla math—never callinggiveExperiencePoints, so XP pickup events and Mending are never spuriously triggered. - Fair Durability Penalty: Defaults to 10% of max durability (
PERCENT_MAX) or optional fixed points (FLAT), withIdentityHashMapdeduplication across armor, hands, and optional Curios, Trinkets, and Accessories slots.- Safe-by-Default & Vanilla-Decoupled Breaking Protocol: Defaults to
allowBreak = false, clamping durability loss to keep at least 1 durability remaining so items never shatter from death penalties. When explicitly set toallowBreak = trueand an item reaches max damage, Keep But Penalty invokes standard vanillaItemStack.hurtAndBreak(...)—destroying the item cleanly in vanilla (no0/maxghost armor) or naturally letting anti-break mods (such as Keep My Sword) take over with zero hardcoded coupling. Vanilla Elytra always stops atmaxDamage - 1(broken-wing state). - Item & Tag Exclusions: Exempt specific items or
#tagsviaexcludedItems(pre-configured with#keep_but_penalty:excluded,#tconstruct:modifiable,#tetra:modular_items, and#slashblade:swords).
- Safe-by-Default & Vanilla-Decoupled Breaking Protocol: Defaults to
- Anti-Suicide Hunger Preservation: Preserves below-full hunger across death with a configurable floor (
minRespawnFoodLevel = 6, 3 drumsticks) so players cannot reset hunger by dying while preventing starvation loops. - Progressive Respawn Debuffs: Optional configurable status effects with consecutive-death duration scaling, persisted in player NBT.
- Respawn Actionbar Summary: Displays a concise one-line summary of actual death costs on respawn (suppressed when no penalty occurred).
- In-Game Config Screen & 4 Languages: Native zero-dependency
KeepButPenaltyConfigScreenaccessible via Mod Menu (Fabric) or the Mods screen (Forge / NeoForge), with full English, 简体中文, 繁體中文, and 日本語 localization.
Configuration
Stored at config/keep_but_penalty.toml (edits saved in-game take effect immediately).
[death]
keepInventory = true
enableExperiencePenalty = true
experienceKeepRatio = 0.75
preserveHungerOnDeath = true
minRespawnFoodLevel = 6
skipOnPvp = false
respawnDebuffs = []
respawnDebuffDurationsSecondsByDeath = []
respawnDebuffStreakResetSeconds = 600
showRespawnSummary = true
[durability]
enableDurabilityPenalty = true
penaltyMode = "PERCENT_MAX"
durabilityPercent = 0.1
durabilityFlat = 80
allowBreak = false
damageArmor = true
damageMainHand = true
damageOffHand = true
damageCurios = true
damageTrinkets = true
damageAccessories = true
excludedItems = ["#keep_but_penalty:excluded", "#tconstruct:modifiable", "#tetra:modular_items", "#slashblade:swords"]
Supported Versions & Loaders
Zero external library dependencies—single self-contained JAR per target:
| Minecraft | Loaders | Optional Accessory Compat |
|---|---|---|
1.20.1 |
Fabric, Forge | Curios, Trinkets, Accessories |
1.21.1 |
Fabric, NeoForge | Curios, Trinkets, Accessories |
26.1.2 |
Fabric, NeoForge | Curios, Trinkets, Accessories |
26.2 |
Fabric, NeoForge | Curios, Trinkets, Accessories |


