概览
minecraft:behavior.sneeze 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物时不时打喷嚏,可能掉落物品并让附近的生物吓得跳起来。熊猫幼崽用它掉落黏液球。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
cooldown_time | number | 0 | 生物再次打喷嚏前等待的秒数。 |
probability | number | 0.02 | 打喷嚏的几率。1 表示每次都会。 |
drop_item_chance | number | 1 | 打喷嚏时掉落物品的几率。 |
loot_table | string | "" | 决定掉落物品的战利品表路径。 |
sound | string | "" | 生物打喷嚏时播放的声音。 |
prepare_sound | string | "" | 打喷嚏前播放的声音。 |
prepare_time | number | 1 | 生物准备打喷嚏所花的秒数。 |
entity_types | EntityTypes | 无 | 它打喷嚏时附近哪些生物会被吓到并跳起来。 |
within_radius | number | 0 | 生物要离多近才会被吓到。 |
priority | integer | 0 | 多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.sneeze": {
"cooldown_time": 0,
"probability": 0.02,
"drop_item_chance": 1,
"loot_table": "",
"sound": "",
"prepare_sound": "",
"prepare_time": 1,
"entity_types": {}
}
}