概览
minecraft:behavior.dig 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物钻入地下并消失的 AI 目标,比如平静下来的监守者。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
duration | number | 0 | 挖掘需要的秒数。 |
idle_time | number | 0 | 开始挖掘前需要多少秒不受干扰。 |
allow_dig_when_named | boolean | false | 为 true 时,即使被命名牌命名,生物仍可以钻地离开。 |
vibration_is_disturbance | boolean | false | 为 true 时,附近的振动会被视为干扰并推迟挖掘。 |
suspicion_is_disturbance | boolean | false | 为 true 时,发现新的可疑位置会推迟挖掘。 |
digs_in_daylight | boolean | false | 为 true 时,生物看到日光就会开始挖掘。 |
on_start | ActorDefinitionTrigger | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | 开始挖掘时触发的事件。 |
priority | integer | 0 | 数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.dig": {
"duration": 0,
"idle_time": 0,
"allow_dig_when_named": false,
"vibration_is_disturbance": false,
"suspicion_is_disturbance": false,
"digs_in_daylight": false,
"on_start": {
"event": "",
"filters": {
"AND": null,
"NOT": null,
"OR": null,
"all": null,
"all_of": null,
"any": null,
"any_of": null,
"none_of": null
},
"target": "self"
},
"priority": 0
}
}