概览
minecraft:exhaustion_values 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 设置玩家的每种动作会消耗多少饥饿值。数值越低玩家饿得越慢;设为 0 则该动作不消耗饥饿值。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
heal | number | 6 | 饥饿值满时恢复生命所增加的消耗度。 |
jump | number | 0.05 | 每次普通跳跃增加的消耗度。 |
sprint_jump | number | 0.2 | 疾跑时每次跳跃增加的消耗度。 |
mine | number | 0.005 | 每挖掘一个方块增加的消耗度。 |
attack | number | 0.1 | 每次攻击增加的消耗度。 |
damage | number | 0.1 | 受到伤害时增加的消耗度。 |
walk | number | 0 | 行走时增加的消耗度。 |
sprint | number | 0.01 | 疾跑时增加的消耗度。 |
swim | number | 0.01 | 游泳时增加的消耗度。 |
lunge | number | 4 | 突进魔咒触发时增加的消耗度,乘以魔咒等级。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:exhaustion_values": {
"heal": 6,
"jump": 0.05,
"sprint_jump": 0.2,
"mine": 0.005,
"attack": 0.1,
"damage": 0.1,
"walk": 0,
"sprint": 0.01
}
}