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

PropertyTypeDefaultWhat it does
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Conditions that need to be met for the behavior to start.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
attack_rangeObject{"max": 0, "min": 0}Target needs to be within this range for the attack to happen.
minDecimal0
maxDecimal0
attack_cooldownDecimalmin 00.5The cooldown time in seconds before this goal can be used again.
pre_shoot_delayDecimalmin 00.75Time in seconds before firing the projectile.
post_shoot_delayDecimalmin 00.2Time in seconds between firing the projectile and ending the goal.
max_head_rotation_xDecimal30Maximum head rotation (in degrees), on the X-axis, that this entity can apply while trying to look at the target.
max_head_rotation_yDecimal30Maximum head rotation (in degrees), on the Y-axis, that this entity can apply while trying to look at the target.
ranged_fovDecimal90Field of view (in degrees) when using sensing to detect a target for attack.
projectile_defText""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_anchorInteger2Entity anchor for the projectile spawn location.
owner_offsetList of decimal or Object[0, 0, 0]Offset vector from the owner_anchor.
xDecimal0
yDecimal0
zDecimal0
target_anchorInteger2Entity anchor for projectile target.
target_offsetList of decimal or Object[0, 0, 0]Offset vector from the target_anchor.
xDecimal0
yDecimal0
zDecimal0
priorityIntegermin 00
control_flagsList 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