Ranged Attack¶
文档版本:1.21.50.25
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
}
priority
:priority
speed_multiplier
:speed_multiplier
attack_interval
:number- 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_max
:number- Maximum bound for reload-time range (in seconds), when not using a charged shot. Reload-time range scales with target-distance.
attack_interval_min
:number- Minimum bound for reload-time range (in seconds), when not using a charged shot. Reload-time range scales with target-distance.
attack_radius
:number- Minimum distance to target before this entity will attempt to shoot.
attack_radius_min
:number- Minimum distance the target can be for this mob to fire. If the target is closer, this mob will move first before firing
burst_interval
:number- Time (in seconds) between each individual shot when firing a burst of shots from a charged up attack.
burst_shots
:integer- Number of shots fired every time the attacking entity uses a charged up attack.
charge_charged_trigger
:number- 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_trigger
:number- 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_fov
:number- Field of view (in degrees) when using sensing to detect a target for attack.
set_persistent
:boolean- Allows the actor to be set to persist upon targeting a player.
swing
:boolean- 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_time
:number- Minimum amount of time (in seconds) the attacking entity needs to see the target before moving toward it.
x_max_rotation
:number- Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target.
y_max_head_rotation
:number- Maximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target.