LifeLedger
一款 Fabric Minecraft 模组,为每位玩家分配有限数量的生命,称为“股份”(stocks)。全部失去后,你将被永久封禁。绝无例外。
该模组旨在验证我的理论:在典型的两周 SMP(生存多人游戏)中,有意义的死亡体验能对游戏的长期性和玩法深度产生积极影响。通过模拟极限模式(Hardcore)的体验
光敏性警告: 本模组包含冲击帧效果,即当你被击中并标记有“死刑判决”物品时出现的短暂闪光特效。如果你畏光,请在游玩前于 Mod Menu → LifeLedger → Client Settings 中禁用此功能 :)
工作原理
每位玩家首次加入服务器时都会被分配一个股份数量。每次死亡扣除一股。归零后,服务器将封禁该玩家。股份数据与 UUID 绑定,并保存在 config/lifeledger-stocks.json 文件中。除非管理员介入并赋予更多股份,否则没有自然恢复的方法。
死亡过滤
并非所有死亡都需要计入。每种死亡类型都可以独立切换:
| 死亡类型 |
开关配置 |
| 怪物击杀 |
countMobDeaths |
| PvP |
countPvpDeaths |
| 摔落伤害 |
countFallDamage |
| 虚空 |
countVoidDeaths |
| 爆炸 |
countExplosionDeaths |
| 火焰 |
countFireDeaths |
| 溺水 |
countDrownDeaths |
| 冻结 |
countFreezeDeaths |
| 魔法伤害 |
countMagicDeaths |
| 窒息 |
countSuffocationDeaths |
| 铁砧 |
countAnvilDeaths |
| 末影龙 |
countEnderDragonDeaths |
| 凋灵 |
countWitherDeaths |
| 远古守卫者 |
countElderGuardianDeaths |
当作为客户端使用模组时,所有可切换项均可见。死亡检查遵循通用层级结构。例如,如果禁用了“怪物击杀”,但启用了“凋灵”、“末影龙”或“远古守卫者”的死亡计数,则会针对特定情况覆盖“怪物击杀”的设置。(来自无关来源的凋灵状态效果不计入此类)
如果你发现有应该添加在这里的内容,请告诉我,或者直接在 GitHub 上提交 PR。
死刑判决
PvP 死亡的判定设计得非常直接(检查 source.getEntity()),以防止灰色地带的死亡被计入。我们不想阻止玩家进行一些“有趣”的操作,比如“友好”地推下悬崖、TNT 陷阱等。我们通过引入并强制执行玩家意图来解决这个问题。这通过“死刑判决”机制处理。
将任意物品重命名为配置的触发名称(默认为 "Death Sentence")(不区分大小写),然后猛烈击打你的朋友;他们现在被标记。如果在配置的时间窗口内,无论因何种原因死亡,都将损失一股股份,不受死亡过滤器设置的影响。
标记会在近战攻击、投射物、TNT 和末地水晶爆炸期间持续存在,并由施加标记的玩家发起的任何持续 aggression 刷新。如果超时、死亡或断开连接,标记会清除(可能会移除断开连接时的清除机制,以抑制滥用行为)。
这一想法同样是让玩家表达意图:如果你嗜血并希望看到某人失去股份,即使关闭了 PvP 死亡计数,也不应保护他们。
默认时间窗口为 20 秒,可以使用以下命令更改:
/lifeledger config deathsentencewindow <seconds>
标签页列表显示
玩家可以选择在标签页列表中直接看到每个人的剩余股份,以小爱心图标显示(包含名字、延迟等信息)。满心代表剩余股份,灰心代表已耗尽的股份。显示上限为 10 个。按客户端单独切换,且客户端侧也需要安装该模组。
配置
该模组本质上是服务器权威的。服务器配置文件位于 config/lifeledger.json。管理员可以通过以下方式在运行时更改设置:
- Mod Menu 通过 Mod Menu 模组内置的配置界面访问(可选,仅客户端侧)。OP 可以看到可编辑的开关;非 OP 用户只能查看只读信息,以便了解哪些功能是开启或关闭的。客户端设置(冲击帧、标签页列表显示)也在此处的单独选项卡下。
- 游戏内命令
/lifeledger config (key) (true|false) 用于所有死亡过滤器开关。
非 OP 命令:
/lifeledger stocks (name) - 检查并输出玩家的股份数量,如果不提供名字,则检查调用命令者的股份数量
管理员命令:
/lifeledger default - 为新玩家设置默认股份数
/lifeledger set - 设置特定玩家的股份数
/lifeledger give - 给玩家增加股份
/lifeledger take - 从玩家处移除股份
/lifeledger get - 检查玩家当前的股份数
/lifeledger config (true|false) - 切换死亡过滤器设置
/lifeledger config deathsentencewindow - 设置死刑判决的时间窗口
/lifeledger testimpact - 在你身上触发冲击帧效果,主要用于测试,不过既然有了就留着吧
待办事项:
修复实现得相当糟糕的冲击帧效果。要做就做硬核的光影效果 >:(
LifeLedger
A Fabric Minecraft mod that gives each player a finite amount of lives, called "stocks". Lose them all and you're permanently banned. No exceptions.
Built to test my theory that having meaningful deaths is a positive impact on the typical 2-week SMP to increase longevity and meaningful gameplay. By emulating the hardcore experience
Photosensitivity warning: This mod includes impact frames, a brief flash effect when you are hit and marked with a "Death sentence" item. If you are sensitive to flashing lights, disable this in Mod Menu → LifeLedger → Client Settings before playing :)
How it works
Every player is assigned a stock count when they first join. Each death removes one stock. Hit zero and the server bans you. Stock data is tied to UUID and is saved in config/lifeledger-stocks.json there is no natural way to get them back unless an admin intervenes and gives you more.
Death filtering
Not every death has to count. Each death type can be toggled independently:
| Death Type |
Toggle |
| Mob kills |
countMobDeaths |
| PvP |
countPvpDeaths |
| Fall damage |
countFallDamage |
| Void |
countVoidDeaths |
| Explosions |
countExplosionDeaths |
| Fire |
countFireDeaths |
| Drowning |
countDrownDeaths |
| Freezing |
countFreezeDeaths |
| Magic |
countMagicDeaths |
| Suffocation |
countSuffocationDeaths |
| Anvil |
countAnvilDeaths |
| Ender Dragon |
countEnderDragonDeaths |
| Wither |
countWitherDeaths |
| Elder Guardian |
countElderGuardianDeaths |
Every toggleable is visible when using the mod as a client, the death check runs on a general hierarchy for example disabling MobDeaths but having Wither, Ender Dragon or Elder Guardian deaths enabled will override MobDeaths for its specific case. (the Wither status effect from unrelated sources doesn't count for its case either)
If you come across something you feel like i should add here let me know, or push it yourself on github.
Death Sentence
The check for PvP deaths is extremely direct (checks source.getEntity()) by design to prevent gray zone deaths from counting we don't want to stop players from doing funny business "friendly" cliff pushing, tnt traps all that. We solve this by introducing and enforcing player intent. This is handled through "Death Sentence".
Rename ANY item to the configured trigger name (default: '"Death Sentence"') (not case sensitive) and brutally punch your friend; they are now marked. If they die within the configured time window from any cause a stock is lost regardless of what the death filter says.
The mark persists across melee hits, projectiles, TNT, and End Crystal detonations and is refreshed by continued aggression from any source originating from the player who applied it. It clears if it times out, on death or disconnect (might remove this disconnect thing to disincentivize abuse).
The idea is again to let players express intent: if you're actively bloodthirsty and want to see someone lose a stock, toggling off PvP deaths shouldn't save them.
The time window is 20 by default, and can be changed using
/lifeledger config deathsentencewindow <seconds>
Tab List Display
Players can optionally see everyone's remaining stocks as little heart icons directly in the tab list (with names and ping and such). Full hearts = remaining stocks, grey hearts = expended stocks. Capped at 10 displayed. Toggled per-client and requires the mod on the client side as well.
Configuration
The mod is inherently server-authoritative. The server config lives at 'config/lifeledger.json' Admins can change settings at runtime via:
- Mod Menu A built-in config screen accessible through the Mod Menu mod (optional, client side). OPs see editable toggles; non-OPs see read only so they know what's off or on. Client settings (impact frames, tab list display) are also here under a separate tab.
- In-game commands '/lifeledger config (key) (true|false)' for all death filter toggles.
Non-op commands:
/lifeledger stocks (name) - checks and outputs the stock count of the player, if no name is given it checks the calling player's stock count
Admin commands:
/lifeledger default - set default stocks for new players
/lifeledger set - set a specific player's stocks
/lifeledger give - add stocks to a player
/lifeledger take - remove stocks from a player
/lifeledger get - check a player's current stocks
/lifeledger config (true|false) - toggle a death filter setting
/lifeledger config deathsentencewindow - sets the time window for death sentence
/lifeledger testimpact - triggers the impact frame on yourself, used for testing but; meh why not have it there
Todo:
Fix the rather badly implemented impact frames. Do hard shader stuff >:(
评论 0
登录后参与评分
还没有评论,来抢沙发吧