概览
minecraft:behavior.random_sitting 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物随机坐下一会儿,然后再站起来。猫用它来休息。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
start_chance | number | 0.1 | 生物坐下的几率,从 0 到 1。 |
stop_chance | number | 0.3 | 生物重新站起来的几率,从 0 到 1。 |
cooldown | number | 100 | 生物再次坐下前等待的秒数。 |
min_sit_time | number | 10 | 生物保持坐下的最短时间(秒)。 |
priority | integer | 0 | 多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.random_sitting": {
"start_chance": 0.1,
"stop_chance": 0.3,
"cooldown": 100,
"min_sit_time": 10,
"priority": 0,
"control_flags": []
}
}