概览
minecraft:behavior.offer_flower 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物向附近拥有 take_flower 目标的生物递出一朵花,就像铁傀儡给村民小孩送虞美人。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
max_offer_flower_duration | number | 20 | 生物递花的最长时间(秒)。范围:0 到 … |
chance_to_start | number | 0.000125 | 目标开始的几率,从 0 到 1。1 表示每次都会开始。范围:0 到 1 |
filters | Filter Group | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | 目标开始运行必须满足的条件。 |
search_area | vec3 | [6,2,6] | 以生物为中心、用来寻找送花对象的范围盒大小。 |
max_rotation_x | number | 30 | 生物看向另一个生物时最多能上下仰俯的角度(度)。范围:0 到 … |
max_head_rotation_y | number | 30 | 生物看向另一个生物时头部最多能左右转动的角度(度)。范围:0 到 … |
priority | integer | 0 | 多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.offer_flower": {
"max_offer_flower_duration": 20,
"chance_to_start": 0.000125,
"filters": {
"AND": null,
"NOT": null,
"OR": null,
"all": null,
"all_of": null,
"any": null,
"any_of": null,
"none_of": null
},
"search_area": [
6,
2,
6
],
"max_rotation_x": 30,
"max_head_rotation_y": 30,
"priority": 0,
"control_flags": []
}
}