Pillagers are near enemies when attacking
When a pillager is aggro to a mob, I goes directly near or next to it when attacking with a crossbow.
Linked Issues
Created Issue:
Pillagers are near enemies when attacking
Environment
When a pillager is aggro to a mob, I goes directly near or next to it when attacking with a crossbow.
When a pillager is aggro to a mob, I goes directly near or next to it when attacking with a crossbow.
When a pillager is aggro to a mob, I goes directly near or next to it when attacking with a crossbow.
is duplicated by
relates to
Java had the same issue, but it was fixed years ago: see MC-137755.
In Bedrock this issue is caused in some way by the component,
"minecraft:behavior.charge_held_item",
which loads the crossbow. If you replace the pillager's crossbow with any other item then it behaves as expected, not rushing up to its target. If you remove the component from the pillager then it cannot attack while holding a crossbow, but it still attacks as expected if you replace the crossbow with any other item.
That aside, the issue can be fixed by inserting
"target_in_sight_time": 0.1,
into "minecraft:behavior.ranged_attack"
This parameter prevents piglins from having this issue. Pillagers use the default sight time of 1 second. I guess that the time gets reset whenever "minecraft:behavior.charge_held_item" runs, and so the pillager runs for exactly 1s after charging its crossbow before it can shoot again.
Pillagers now shoot from a distance in 18w46a, resolving as fixed.