Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Links
Creators
Details
Smart Keep Inventory
In vanilla you can only either have keep inventory enabled all time or not. Smart Keep Inventory allows you to decide under which conditions the players inventory should be kept upon death.
For example you can have it configured to only allow keep inventory if the player is killed by a specific mob.
⚙️ Configuration
By default this mod does not do anything and requires configurations from the users.
Configuration is done via a datapack.
Conditions are defined via a file under data/<namespace>/smart_keep_inventory/checks
and have the following format:
{
"player": <EntityPredicate>, // Optional. This is the player that died
"killer": <EntityPredicate>, // Optional. This entity that killed the player. Directly or indirectly
"damage": <DamageSourcePredicate>, // Optional. The damagesource that killed the player
"keepExperience": <true | false>, // Default true. Whether to also keep the players experiences or not
"disabled": <true | false> // Optional. Only used to disable an EXISTING condition with the same id
}
For more information about predicates check out the minecraft wiki under https://minecraft.wiki/w/Predicate
Example:
This allows the player to keep their inventories if they are killed by a zombie but not their xp.
{
"killer": {
"type": "minecraft:zombie"
},
"keepExperience": false
}
Compability
This mod should support any mod adding inventories (Curios, Accessory etc.) provided they respected the gamerule already.
Gravestone mods should also be supported if they already check the gamerule. If a player keeps their inventory a grave should not be generated in that case.


