Thirst System 为你的服务器添加了生存口渴机制,让玩家在饥饿之外多了一项需要管理的生存需求。保持水分成为日常生存的一部分,忽视它会产生真实的后果,因此玩家必须像规划食物一样,去规划和携带水源。
每位玩家都有一个从 0 到 20 的口渴值。随着饥饿值的消耗,口渴值会缓慢下降;玩家活动越频繁,口渴的速度就越快。当口渴值降低时,玩家将受到负面影响:中等口渴速度会导致迟缓,更低口渴会增加恶心效果,而极低的口渴则会叠加挖掘疲劳。如果口渴值降至零,玩家将持续受到伤害,若不及时饮水最终会因口渴而死,并会显示一条自定义的死亡消息来宣告这一结局。
为了保持水分,玩家可以饮用多种物品。牛奶、蜂蜜瓶和普通水瓶都能恢复部分口渴值,但核心道具是自定义的水壶(water flask)。水壶是一种可制作、可补充水分的容器,最多可容纳 100 单位的水。玩家手持水壶右键点击水源即可将其装满,每次从中饮水时,水量会减少 1 点,其显示文本也会更新以展示剩余水量。当水壶中的水耗尽后,它会变成一个可重复使用的空水壶,只需再次装满即可继续使用,只要玩家不断补水,单个水壶就可以无限期使用。这两种水壶均为单格堆叠物品,并带有微弱的附魔光泽,以便在背包中突出显示。
在底层实现上,每位玩家的口渴值直接通过持久化数据存储在玩家实体上,因此即使玩家离线或服务器重启,数据也不会丢失,无需依赖单独的数据库。负面效果以无限持续时间的药水效果形式应用,并经过精心管理,确保饮用牛奶(通常清除所有效果)不会移除口渴相关的惩罚,同时仍允许其清除玩家在别处获得的其他真实效果。口渴值为零时的伤害由一个自取消任务处理,该任务还会考虑吸收之心并绕过护甲保护,以确保伤害无法被阻挡;如果玩家因口渴伤害死亡,系统会标记该情况以显示正确的死亡消息。水壶的剩余水量存储在其自身的显示文本中,并通过隐藏的数据标签进行识别,插件正是借此区分真正的水壶和普通原版水瓶。水壶和空水壶分别分配了自定义模型数据字符串(分别为 water_flask 和 empty_water_flask),因此服务器管理员如有需要,可以通过资源包为它们应用自定义纹理。玩家的当前口渴值通过 PlaceholderAPI 暴露出来,你可以根据喜好以任何方式显示它。
此插件没有配置文件。任何自定义行为都需要直接修改源代码并从头重新构建 jar 文件。
此插件专为运行在 PaperMC 上的 Minecraft 26.2 版本构建。它在旧版或新版 Minecraft 或其他服务器软件上可能兼容,也可能不兼容。
此插件依赖于 PlaceholderAPI 和 AuraSkills:
-
AuraSkills:
-
PlaceholderAPI:
-
此插件旨在与 AuraSkills 配合使用,通过 PlaceholderAPI 在 AuraSkills 的操作栏中显示口渴值,但它也可以在没有 AuraSkills 的情况下单独工作。AuraSkills 的操作栏仅是向玩家显示口渴值的一种方式。如果你希望通过其他方式(例如支持 PlaceholderAPI 的记分板)显示口渴值,请使用占位符 %thirst_%;但你需要从 plugin.yml 文件的依赖列表中移除 AuraSkills,然后重新构建插件。
-
如果你打算将此插件与 AuraSkills 一起使用,请确保通过访问 plugins/AuraSkills/messages/global.yml 正确配置 AuraSkills,并将上述占位符放置在你认为合适的任何位置。
如需支持或提问,请加入我的 Discord 服务器:
根据 Apache License 2.0 授权
Thirst System adds a survival thirst mechanic to your server, giving players a second need to manage alongside hunger. Staying hydrated becomes part of everyday survival, and neglecting it has real consequences, so players have to plan around finding and carrying water the same way they plan around food
Every player has a thirst level that ranges from 0 to 20. Thirst slowly drops as the player's hunger drains, so the more active a player is, the faster they get thirsty. As thirst falls, the player starts to suffer for it: at moderate thirst they get slowness, even lower thirst adds nausea, and very low thirst piles on mining fatigue as well. If thirst ever hits zero, the player takes damage over time and will eventually die of thirst if they don't drink, complete with a custom death message announcing it
To stay hydrated, players can drink several things. Milk, honey bottles, and ordinary water bottles all restore some thirst, but the centrepiece is the custom water flask. The water flask is a craftable, refillable container that holds up to 100 units of water. Players fill it by right clicking a water source with it in hand, and every time they drink from it the water level ticks down by one and its display updates to show how much is left. When the flask runs dry it turns into a reusable empty water flask, which can simply be refilled again, so a single flask lasts indefinitely as long as the player keeps topping it up. Both flasks are single-item stacks with a subtle enchanted glint so they stand out in the inventory
Under the hood, each player's thirst value is stored directly on the player using persistent data, so it survives logouts and server restarts without needing a separate database. The negative effects are applied as infinite-duration potion effects and are carefully managed so that drinking milk, which normally clears all effects, won't remove the thirst penalties while still letting it remove genuine effects the player picked up elsewhere. The damage at zero thirst is handled by a self-cancelling task that also accounts for absorption hearts and bypasses armor so it can't be blocked, and it flags the player if the thirst damage is what killed them so the correct death message can be shown. The water flask stores its remaining water amount in its own display text and is identified by a hidden data tag, which is how the plugin tells a real flask apart from an ordinary vanilla water bottle. Both the water flask and the empty water flask have a custom model data string assigned to them (water_flask and empty_water_flask respectively), so server owners can apply custom textures to them through a resource pack if they wish. The player's current thirst is exposed through PlaceholderAPI, so it can be displayed however you like
This plugin has no config file. Any custom behaviour requires modifying the source code directly and rebuilding the jar from scratch
This plugin was built for Minecraft 26.2 running on PaperMC. It may or may not work on older or newer versions of Minecraft or other server software
This plugin depends on PlaceholderAPI and AuraSkills
-
AuraSkills:
-
PlaceholderAPI:
-
This plugin is intended to work alongside AuraSkills to display the thirst in AuraSkills' actionbar through the use of PlaceholderAPI however it can work without AuraSkills as well. AuraSkills' actionbar is just a way of displaying the thirst to the player. If you want to display the thirst through some other way such as a scoreboard that supports PlaceholderAPI, use %thirst_% for the placeholder, however you would need to remove AuraSkills from the dependency list in the plugin.yml file then rebuild the plugin
-
If you intend to use AuraSkills alongside this plugin then make sure to configure AuraSkills properly by going to plugins/AuraSkills/messages/global.yml and placing the said placeholder wherever you deem appropriate
For support or questions, join my discord server:
Licensed under the Apache License 2.0
评论 0
登录后参与评分
还没有评论,来抢沙发吧