士气提升
一款适用于 Minecraft 服务器的协作团队士气系统
此模组用于角色扮演(RP),管理员作为游戏主持人使用。请使用 morale:add 命令来增加士气。
概述
Morale Boost 添加了一个共享的团队士气分数,该分数会根据你们团队的共同行为而升降。度过夜晚,士气上升;目睹队友死亡,全队都会感受到影响。士气直接影响每位玩家的速度和攻击速度,超过上限则解锁增益状态,使全队移动更快、攻击更重。
专为协作生存和中世纪/角色扮演服务器设计。
功能
- 共享士气分数 — 整个团队共用一个值,范围从
0 到 150
- 死亡惩罚 — 每次死亡扣除团队
-5 士气,并向所有玩家广播具有氛围感的提示消息
- 睡眠奖励 — 每个在床上睡觉的玩家提供
+1 士气
- 被动消耗 — 当士气高于
100 时,会随时间缓慢下降(每分钟 1 点)
- 溢出增益 — 当士气高于
100 时,所有玩家获得 +20% 攻击速度和 +10% 移动速度加成
- 渐进惩罚 — 低士气会在多个阈值下施加递增的攻击速度和移动速度减益效果
- 调试命令 — 内置供服务器管理员使用的调试功能
士气阈值
惩罚(士气 ≤ 100)
| 士气范围 |
攻击速度 |
移动速度 |
| 101+ |
+20% (溢出增益) |
+10% (溢出增益) |
| 90–100 |
— |
— |
| 85–89 |
−7% |
— |
| 80–84 |
−14% |
— |
| 75–79 |
−21% |
−3% |
| 70–74 |
−28% |
−6% |
| 65–69 |
−35% |
−9% |
| 60–64 |
−35% |
−12% |
| 55–59 |
−35% |
−15% |
| 50–54 |
−35% |
−18% |
| 45–49 |
−35% |
−21% |
| 40–44 |
−35% |
−24% |
| 35–39 |
−35% |
−27% |
| ≤ 34 |
−35% |
−30% |
士气的上限为 150,下限为 0。
士气变化一览
| 事件 |
士气变化 |
| 玩家死亡 |
−5 |
| 玩家在床上睡觉 |
+1 |
| 溢出消耗(高于 100) |
每分钟 −1 |
溢出消耗仅在士气高于 100 时生效。一旦回到 100 或以下,计时器重置。
命令
所有命令需要操作员权限(/op)。
查看士气状态
/function morale:status
向所有玩家显示当前团队士气,并根据范围进行着色。
手动调整士气
/function morale:add_morale_1
/function morale:add_morale_5
/function morale:add_morale_10
/function morale:add_morale_15
/function morale:add_morale_25
向团队士气添加指定数值。上限为 150。
调试信息
/function morale:debug
广播面向管理员的调试面板,显示当前士气、溢出计时器(以刻为单位)以及累计死亡次数。
安装
- 下载
Morale_Boost_release.zip
- 将
.zip 文件放入世界的 datapacks 文件夹中:
<world_folder>/datapacks/
- 在游戏中或服务器控制台中运行:
/reload
数据包加载时会自动初始化。如果不存在之前的值,士气初始化为 100。
兼容性
| 版本 |
状态 |
| Minecraft 26.2 (数据包格式 107) |
✅ 支持 |
| Minecraft 1.21.11-1.21.5 |
可能支持? |
| Minecraft 1.20.x 及以下 |
❌ 不支持 |
此数据包使用了 1.21 引入的 attribute modifier add 命令语法。它在旧版本中将无法正常工作。
给服务器管理员的说明
- 死亡检测系统通过比较每个刻内所有玩家的总死亡次数来工作。
on_join 进度使用 minecraft:tick 作为触发条件,该触发在玩家进入世界的第一刻仅触发一次。授予后会自动撤销,因此如果玩家重新加入,它会再次正确触发。
- 没有 GUI 或 Boss 血条 — 士气反馈通过聊天消息和
/function morale:status 命令提供。
由 Toba Garage Gamedev Department 的需求制作
许可证
GNU GPL v3
Morale Boost
A cooperative team morale system for Minecraft servers
This mod is used for RP with admins as gamemasters. Use function morale:add commands to give morale.
Overview
Morale Boost adds a shared Team Morale score that rises and falls based on what your team does together. Sleep through the night, and morale climbs. Watch a teammate die, and the whole team feels it. Morale directly affects every player's movement speed and attack speed, and going beyond the cap unlocks a buff state that makes the whole team faster and hit harder.
Designed for cooperative survival and medieval/roleplay servers.
Features
- Shared morale score — one value for the whole team, ranging from
0 to 150
- Death penalty — every death costs the team
-5 morale, with atmospheric flavor messages broadcast to all players
- Sleep bonus — each player who sleeps in a bed grants
+1 morale
- Passive drain — morale above
100 slowly drains back down over time (1 point per minute)
- Overflow buff — morale above
100 grants all players a +20% attack speed and +10% movement speed bonus
- Gradual penalties — low morale applies increasing attack speed and movement speed debuffs across multiple thresholds
- Debug command — built-in debug function for server admins
Morale Thresholds
Penalties (morale ≤ 100)
| Morale Range |
Attack Speed |
Movement Speed |
| 101+ |
+20% (overflow buff) |
+10% (overflow buff) |
| 90–100 |
— |
— |
| 85–89 |
−7% |
— |
| 80–84 |
−14% |
— |
| 75–79 |
−21% |
−3% |
| 70–74 |
−28% |
−6% |
| 65–69 |
−35% |
−9% |
| 60–64 |
−35% |
−12% |
| 55–59 |
−35% |
−15% |
| 50–54 |
−35% |
−18% |
| 45–49 |
−35% |
−21% |
| 40–44 |
−35% |
−24% |
| 35–39 |
−35% |
−27% |
| ≤ 34 |
−35% |
−30% |
Morale is capped at a maximum of 150 and a minimum of 0.
Morale Changes at a Glance
| Event |
Morale Change |
| Player death |
−5 |
| Player sleeps in bed |
+1 |
| Overflow drain (above 100) |
−1 per minute |
The overflow drain only ticks while morale is above 100. Once it returns to 100 or below, the timer resets.
Commands
All commands require operator permissions (/op).
Check Morale Status
/function morale:status
Displays the current team morale to all players, color-coded by range.
Manually Adjust Morale
/function morale:add_morale_1
/function morale:add_morale_5
/function morale:add_morale_10
/function morale:add_morale_15
/function morale:add_morale_25
Adds the specified amount to team morale. Caps at 150.
Debug Info
/function morale:debug
Broadcasts an admin-facing debug panel showing current morale, overflow timer (in ticks), and cumulative death count.
Installation
- Download
Morale_Boost_release.zip
- Place the
.zip file into your world's datapacks folder:
<world_folder>/datapacks/
- In-game or in the server console, run:
/reload
The pack initializes automatically on load. Morale starts at 100 if no previous value exists.
Compatibility
| Version |
Status |
| Minecraft 26.2 (pack format 107) |
✅ Supported |
| Minecraft 1.21.11-1.21.5 |
Maybe Supported? |
| Minecraft 1.20.x and below |
❌ Not supported |
This datapack uses the attribute modifier add command syntax introduced in 1.21. It will not function correctly on older versions.
Notes for Server Owners
- The death detection system works by comparing a running total of all player deaths each tick.
- The
on_join advancement uses minecraft:tick as its trigger, which fires once on a player's first tick. It is automatically revoked after granting, so it re-fires correctly if a player re-joins.
- There is no GUI or boss bar — morale feedback is delivered through chat messages and the
/function morale:status command.
Made for the need of Toba Garage Gamedev Department
License
GNU GPL v3
评论 0
登录后参与评分
还没有评论,来抢沙发吧