minecraft:behavior.fire_at_target
Allows an entity to attack by firing a shot with a delay. Anchor and offset parameters of this component overrides the anchor and offset from projectile component.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Conditions that need to be met for the behavior to start. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
attack_range | Object | {"max": 0, "min": 0} | Target needs to be within this range for the attack to happen. |
min | Decimal | 0 | |
max | Decimal | 0 | |
attack_cooldown | Decimalmin 0 | 0.5 | The cooldown time in seconds before this goal can be used again. |
pre_shoot_delay | Decimalmin 0 | 0.75 | Time in seconds before firing the projectile. |
post_shoot_delay | Decimalmin 0 | 0.2 | Time in seconds between firing the projectile and ending the goal. |
max_head_rotation_x | Decimal | 30 | Maximum head rotation (in degrees), on the X-axis, that this entity can apply while trying to look at the target. |
max_head_rotation_y | Decimal | 30 | Maximum head rotation (in degrees), on the Y-axis, that this entity can apply while trying to look at the target. |
ranged_fov | Decimal | 90 | Field of view (in degrees) when using sensing to detect a target for attack. |
projectile_def | Text | "" | Actor definition to use as projectile for the ranged attack. The actor must be a projectile. This field is required for the goal to be usable. |
owner_anchor | Integer | 2 | Entity anchor for the projectile spawn location. |
owner_offset | List of decimal or Object | [0, 0, 0] | Offset vector from the owner_anchor. |
x | Decimal | 0 | |
y | Decimal | 0 | |
z | Decimal | 0 | |
target_anchor | Integer | 2 | Entity anchor for projectile target. |
target_offset | List of decimal or Object | [0, 0, 0] | Offset vector from the target_anchor. |
x | Decimal | 0 | |
y | Decimal | 0 | |
z | Decimal | 0 | |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Breeze uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.fire_at_target": {
"post_shoot_delay": 0.2,
"attack_cooldown": 0.5,
"attack_range": {
"min": 0,
"max": 16
},
"filters": {
"all_of": [
{
"test": "is_navigating",
"value": false
}
]
},
"owner_anchor": 2,
"owner_offset": [
0.0,
0.3,
0.0
],
"pre_shoot_delay": 0.75,
"priority": 2,
"projectile_def": "minecraft:breeze_wind_charge_projectile",
"ranged_fov": 90.0,
"target_anchor": 0,
"target_offset": [
0.0,
0.5,
0.0
]
}
}Used by 1
Vanilla entities with minecraft:behavior.fire_at_target in their definition:
Related components
behavior.nearest_attackable_targetbehavior.melee_box_attackbehavior.ranged_attackbehavior.stomp_turtle_eggbehavior.leap_at_targetbehavior.nearest_prioritized_attackable_targetbehavior.aquatic_charge_attackbehavior.charge_held_itembehavior.guardian_attackbehavior.ocelotattackbehavior.slime_attackbehavior.charge_attackbehavior.delayed_attackbehavior.dragonchargeplayerbehavior.dragonflamingbehavior.dragonstrafeplayerbehavior.knockback_roarbehavior.melee_attackbehavior.ram_attackbehavior.roarbehavior.send_eventbehavior.sonic_boombehavior.stomp_attackbehavior.summon_entity