概览
minecraft:behavior.pet_sleep_with_owner 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让被驯服的宠物跳上床和主人一起睡觉,就像猫那样。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
speed_multiplier | number | 1 | 这个目标运行时让生物加速或减速:1 为正常速度。 |
search_range | integer | 0 | 主人在水平方向上多远以内,宠物才会来到床边。 |
search_height | integer | 1 | 主人在上下方向上多远以内,宠物才会来到床边。 |
goal_radius | number | 0.5 | 生物需要靠近到多近才算到达。留一点余地可以避免它在原地来回抖动。 |
priority | integer | 0 | 多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.pet_sleep_with_owner": {
"speed_multiplier": 1,
"search_range": 0,
"search_height": 1,
"goal_radius": 0.5,
"priority": 0,
"control_flags": []
}
}