The new Pillager mob tries to get close to it's target after reloading the crossbow. This should not be the case, they should try to shoot from the furthest distance possible, like skeletons do.
Linked issues
is duplicated by 3
Attachments
Comments 13
@Euwill Eusebio they don't do that in Java Edition. They get close, recharge and then shoot.
In Bedrock, they recharge, get close (sometimes they literally start pushing the target) and then shoot.
The Piglin mobs in the beta versions don't show the occurence of this behavior. It's still a bug exclusive to the Pillager.
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.
I spent years researching and finally managed to fix the AI of the Bedrock Edition pillager, making it possible to match the Java version of pillagers:
[media]ps. The angry components can be removed. I added them because of the "reinforcements" mob behaviour in Java edition. Refer to wiki illager page, on all difficulty levels, damaged illager mobs call all other illagers of their respective type within an area centered on the attacked illager to target the attacker, as long as the attacker is a non-illager.
This is an intentional behaviour. Pillagers do this in Java edition as well.