概览
minecraft:behavior.jump_around_target 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物跳过或绕过目标、落在目标身后的 AI 目标,比如旋风人。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
filters | Filter Group | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | 生物跳跃前必须满足的条件。 |
jump_cooldown_duration | number | 0.5 | 再次跳跃前等待的秒数。 |
jump_cooldown_when_hurt_duration | number | 0.1 | 如果生物最近受过伤,再次跳跃前等待的秒数。 |
last_hurt_duration | number | 2 | 如果生物在这么多秒内受过伤,则改用受伤冷却时间。 |
prepare_jump_duration | number | 0.5 | 跳跃前生物蹲伏的秒数。 |
max_jump_velocity | number | 1.4 | 起跳时的最大速度。 |
check_collision | boolean | false | 为 true 时,会检查跳跃路径上的方块。这会消耗更多性能,请谨慎使用。 |
entity_bounding_box_scale | number | 0.7 | 跳跃期间缩小或放大生物的碰撞箱。数值越小越不容易撞到方块。 |
line_of_sight_obstruction_height_ignore | integer | 4 | 检查生物能否看到目标时,会忽略低于这么多格的障碍物。 |
valid_distance_to_target | FloatRange | {"max":20,"min":4} | 可以跳跃时目标的最近和最远距离。 |
landing_position_spread_degrees | integer | 90 | 目标身后落点可以变化的角度范围。0 表示落在正后方。 |
landing_distance_from_target | FloatRange | {"max":8,"min":4} | 落点离目标的最近和最远距离。 |
required_vertical_space | integer | 4 | 生物头顶需要多少格空气才能跳跃。 |
snap_to_surface_block_range | integer | 10 | 在落点上下检查多少格来寻找地面。 |
jump_angles | number[] | [40,55,60,75,80] | 生物可以使用的跳跃角度,按随机顺序选择。 |
priority | integer | 0 | 数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 … |
control_flags | Goal's control flags[] | 无 | 此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:behavior.jump_around_target": {
"filters": {
"AND": null,
"NOT": null,
"OR": null,
"all": null,
"all_of": null,
"any": null,
"any_of": null,
"none_of": null
},
"jump_cooldown_duration": 0.5,
"jump_cooldown_when_hurt_duration": 0.1,
"last_hurt_duration": 2,
"prepare_jump_duration": 0.5,
"max_jump_velocity": 1.4,
"check_collision": false,
"entity_bounding_box_scale": 0.7
}
}