mojira.dev
MCPE-42471

Pillagers try to get close to the target before attacking

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

Attachments

Comments 13

Euwill Eusebio

This is an intentional behaviour. Pillagers do this in Java edition as well.

@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.

Euwill Eusebio

Ah, I see now. You're right.

The Piglin mobs in the beta versions don't show the occurence of this behavior. It's still a bug exclusive to the Pillager.

Still not fixed in 1.16.1

 

3 more comments

Affects 1.20. They dash to the player after they finish charging their crossbow.

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.

OpaqueSleet7802

I've attached a behavior pack based on GoldenHelmet's fix.

[media]

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.

Still affects the latest release 1.21.51

[Mod] LateLag

(Unassigned)

181043, 718959

Confirmed

Multiple

Android 7.0

1.19.50.22 Preview, 1.19.50.21 Preview, 1.19.50.20 Preview, 1.19.40.24 Preview, 1.13.0.1 Beta, ..., 1.19.10, 1.19.22 Hotfix, 1.19.31 Hotfix, 1.19.40, 1.20.62 Hotfix

Retrieved