跳转至

Ranged Attack

文档版本:1.21.0.24

Allows the mob to use ranged attacks like shooting arrows.

架构

ranged_attack:
{
  priority "priority"
  speed_multiplier "speed_multiplier"
  number "attack_interval" : opt
  number "attack_interval_max" : opt
  number "attack_interval_min" : opt
  number "attack_radius" : opt
  number "attack_radius_min" : opt
  number "burst_interval" : opt
  integer "burst_shots" : opt
  number "charge_charged_trigger" : opt
  number "charge_shoot_trigger" : opt
  number "ranged_fov" : opt
  boolean "set_persistent" : opt
  boolean "swing" : opt
  number "target_in_sight_time" : opt
  number "x_max_rotation" : opt
  number "y_max_head_rotation" : opt
}
prioritypriority
priority:
integer
speed_multiplierspeed_multiplier
speed_multiplier:
number
attack_intervalnumber
Alternative to "attack_interval_min" & "attack_interval_max". Consistent reload-time (in seconds), when not using a charged shot. Does not scale with target-distance.
attack_interval_maxnumber
Maximum bound for reload-time range (in seconds), when not using a charged shot. Reload-time range scales with target-distance.
attack_interval_minnumber
Minimum bound for reload-time range (in seconds), when not using a charged shot. Reload-time range scales with target-distance.
attack_radiusnumber
Minimum distance to target before this entity will attempt to shoot.
attack_radius_minnumber
Minimum distance the target can be for this mob to fire. If the target is closer, this mob will move first before firing
burst_intervalnumber
Time (in seconds) between each individual shot when firing a burst of shots from a charged up attack.
burst_shotsinteger
Number of shots fired every time the attacking entity uses a charged up attack.
charge_charged_triggernumber
Time (in seconds, then add "charge_shoot_trigger"), before a charged up attack is done charging. Charge-time decays while target is not in sight.
charge_shoot_triggernumber
Amount of time (in seconds, then doubled) a charged shot must be charging before reloading burst shots. Charge-time decays while target is not in sight.
ranged_fovnumber
Field of view (in degrees) when using sensing to detect a target for attack.
set_persistentboolean
Allows the actor to be set to persist upon targeting a player.
swingboolean
If a swing animation (using variable.attack_time) exists, this causes the actor to swing their arm(s) upon firing the ranged attack.
target_in_sight_timenumber
Minimum amount of time (in seconds) the attacking entity needs to see the target before moving toward it.
x_max_rotationnumber
Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target.
y_max_head_rotationnumber
Maximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target.