概览
minecraft:behavior.aquatic_charge_attack 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 水生生物的 AI 目标:冲向目标,击中时将其击退,然后休息一会儿再冲。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
max_charge_distance | number | 16 | 生物尝试冲撞时目标的最远距离。范围:0 到 … |
charge_speed | number | 0.06 | 冲撞时生物的游动速度。范围:0.05000000074505806 到 … |
attack_reach | number | 0.05 | 在生物碰撞箱周围额外增加的仍算命中的距离。范围:0 到 … |
knockback_force | number | 2 | 击中时目标被推开的力度。范围:0 到 … |
charge_overshoot_distance | number | 1.5 | 生物瞄准点超过目标的距离,让它直接冲过去而不是在前面停下。范围:0 到 … |
charge_cooldown_time | FloatRange | {"max":6,"min":2} | 下一次冲撞前的随机等待秒数范围。 |
priority | integer | 0 | 数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.aquatic_charge_attack": {
"max_charge_distance": 16,
"charge_speed": 0.06,
"attack_reach": 0.05,
"knockback_force": 2,
"charge_overshoot_distance": 1.5,
"charge_cooldown_time": {
"max": 6,
"min": 2
},
"priority": 0,
"control_flags": []
}
}