Smart Keep Inventory
原版中你只能选择始终保留物品栏或从不保留。Smart Keep Inventory 允许你决定在何种条件下玩家死亡后应保留其物品栏。
例如,你可以将其配置为仅在玩家被特定生物击杀时才保留物品栏。
默认情况下,此模组会使得玩家在被 Boss(标记为 c:bosses 的生物)击杀时保留其物品栏和经验值。
⚙️ 配置
配置通过数据包完成。
条件定义位于 data/<namespace>/smart_keep_inventory/condition 下的文件中,格式如下:
{
"player": <EntityPredicate>, // 可选。这是死亡的玩家
"killer": <EntityPredicate>, // 可选。杀死玩家的实体。直接或间接
"damage": <DamageSourcePredicate>, // 可选。杀死玩家的伤害来源
"keepExperience": <true | false>, // 默认为 true。是否也保留玩家的 experience 值
"disabled": <true | false> // 可选。仅用于禁用具有相同 ID 的现有条件
}
有关谓词(Predicates)的更多信息,请参阅 Minecraft Wiki:
该模组还允许你反转 EntityPredicate。语法如下:
// 不只是使用 <EntityPredicate>,而是这样包裹它
{
"invert":true,
"predicate": <EntityPredicate>
}
示例:
这允许玩家在被僵尸击杀时保留物品栏但不保留经验值。
{
"killer": {
"type": "minecraft:zombie"
},
"keepExperience": false
}
以下是应用于 Boss 的模组默认配置:
{
"killer": {
"type": "#c:bosses"
}
}
兼容性
此模组应支持任何添加物品栏的模组(如 Curios、Accessory 等),前提是该模组已遵守游戏规则。
墓碑模组也应得到支持,如果它们已经检查了该游戏规则。在这种情况下,如果玩家保留了物品栏,则不应生成墓碑。
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.
By default this mod makes it so players will keep their inventory and experiences if they are killed by bosses (mobs tagged as c:bosses)
⚙️ Configuration
Configuration is done via a datapack.
Conditions are defined via a file under data/<namespace>/smart_keep_inventory/condition
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
The mod also allows you to invert EntityPredicate. The syntax for that is as follow:
// Instead of just <EntityPredicate> wrap it like this
{
"invert":true,
"predicate": <EntityPredicate>
}
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
}
The following is the default configuration of the mod applying to bosses:
{
"killer": {
"type": "#c:bosses"
}
}
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.
评论 0
登录后参与评分
还没有评论,来抢沙发吧