1. Wiki
  2. /实体
  3. /minecraft:behavior.jump_around_target

minecraft:behavior.jump_around_target

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:behavior.jump_around_target。Get GodCraft

概览

minecraft:behavior.jump_around_target 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物跳过或绕过目标、落在目标身后的 AI 目标,比如旋风人。

字段

字段类型默认值说明
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}生物跳跃前必须满足的条件。
jump_cooldown_durationnumber0.5再次跳跃前等待的秒数。
jump_cooldown_when_hurt_durationnumber0.1如果生物最近受过伤,再次跳跃前等待的秒数。
last_hurt_durationnumber2如果生物在这么多秒内受过伤,则改用受伤冷却时间。
prepare_jump_durationnumber0.5跳跃前生物蹲伏的秒数。
max_jump_velocitynumber1.4起跳时的最大速度。
check_collisionbooleanfalse为 true 时,会检查跳跃路径上的方块。这会消耗更多性能,请谨慎使用。
entity_bounding_box_scalenumber0.7跳跃期间缩小或放大生物的碰撞箱。数值越小越不容易撞到方块。
line_of_sight_obstruction_height_ignoreinteger4检查生物能否看到目标时,会忽略低于这么多格的障碍物。
valid_distance_to_targetFloatRange{"max":20,"min":4}可以跳跃时目标的最近和最远距离。
landing_position_spread_degreesinteger90目标身后落点可以变化的角度范围。0 表示落在正后方。
landing_distance_from_targetFloatRange{"max":8,"min":4}落点离目标的最近和最远距离。
required_vertical_spaceinteger4生物头顶需要多少格空气才能跳跃。
snap_to_surface_block_rangeinteger10在落点上下检查多少格来寻找地面。
jump_anglesnumber[][40,55,60,75,80]生物可以使用的跳跃角度,按随机顺序选择。
priorityinteger0数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 …
control_flagsGoal'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
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more