Fabric 1.18.2
A simple, configurable Fabric mod that lets modpack authors control what happens to players on respawn after death.
config/death_penalty.json
enabled (boolean) - Enables or disables the mod entirely.
onlyWithKeepInventory (boolean) - If true, penalties only apply when the keepInventory gamerule is enabled.
dev (boolean) - Enables debug logging in console and chat. - Recommended while building a modpack.
matchMode (string) - FIRST (default) -> only highest priority rule applies - ALL -> every matching rule applies
Each rule contains:
name (string), priority (number, higher runs first), when (array of strings), where (array of strings), from (array of strings), using (array of strings), penalties (array of penalty objects)
Any field can be omitted or empty to match everything.
Matches the cause category
Example: mob, lava, fall, explosion, fire, magic, projectile
Matches the dimension ID.
Example: minecraft:overworld, minecraft:the_nether, minecraft:*
Matches the attacker entity type.
Example: minecraft:zombie, minecraft:*_dragon, #minecraft:skeletons
Supports: Exact IDs, Wildcards (*), Entity tags (#namespace:tag)
Matches: Attacker main-hand item, Projectile item, Damage source entity type
Supports: Exact IDs, Wildcards (*), Item tags (#namespace:tag)
The '*' character works as a glob wildcard.
Examples:
minecraft:*_sword\ mymod:*_boss
Use the format:
#namespace:tagname
Examples:
#c:arrows\ #minecraft:skeletons
Tag matching works for: Entity type tags (from) and Item tags (using)
Sets player health.
Fields:, value (float)
Sets hunger and saturation.
Fields: value (int), saturationValue (float)
Keeps a percentage of total XP.
Fields: valueF (float between 0 and 1)
Applies a status effect.
Fields: effect (status effect ID), duration (ticks), amplifier (int), ambient (boolean), showParticles (boolean), showIcon (boolean)
Vanishes all Curse of Vanishing items, and removes a configurable percentage of an items count (rounded up) if that item is in the tag #death_penalty:item_drop_penalty_items
Fields: valueF (float between 0 and 1)
{
"name": "All zombie melee deaths hurt",
"priority": 50,
"from": ["minecraft:zombie"],
"using": ["minecraft:*_sword"],
"penalties": [
{ "type": "set_food", "value": 4, "saturationValue": 0.0 }
]
}
Enable:\ "dev": true
You will see: Cause, Attacker, Held item, Source entity, Flags, UsingItem