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

minecraft:behavior.fire_at_target

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

概览

minecraft:behavior.fire_at_target 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物短暂蓄力后向目标发射弹射物的 AI 目标,比如旋风人。这里的锚点和偏移设置会覆盖弹射物自身的设置。

字段

字段类型默认值说明
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}生物射击前必须满足的条件。
attack_rangeFloatRange{"max":0,"min":0}可以射击时目标的最近和最远距离。
attack_cooldownnumber0.5此目标再次运行前需要等待的秒数。范围:0 到 …
pre_shoot_delaynumber0.75射击前蓄力的秒数。范围:0 到 …
post_shoot_delaynumber0.2射击后到目标结束的秒数。范围:0 到 …
max_head_rotation_xnumber30瞄准时头部最多能上下倾斜的角度。
max_head_rotation_ynumber30瞄准时头部最多能左右转动的角度。
ranged_fovnumber90用于发现目标的视野角度。
projectile_defstring""发射的实体。必须是弹射物,没有它此目标不起作用。
owner_anchorProjectileAnchorProxy2弹射物在射击者身上出现的位置。
owner_offsetvec3[0,0,0]相对于 owner_anchor 点的偏移。
target_anchorProjectileAnchorProxy2弹射物瞄准的目标身上的位置。
target_offsetvec3[0,0,0]相对于 target_anchor 点的偏移。
priorityinteger0数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 …
control_flagsGoal's control flags[]无此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

BP/entities/<name>.json
{
  "minecraft:behavior.fire_at_target": {
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "attack_range": {
      "max": 0,
      "min": 0
    },
    "attack_cooldown": 0.5,
    "pre_shoot_delay": 0.75,
    "post_shoot_delay": 0.2,
    "max_head_rotation_x": 30,
    "max_head_rotation_y": 30,
    "ranged_fov": 90
  }
}

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