Steps to reproduce
In creative mode, wait for a pillager patrol to spawn naturally.
Spawn a villager near the pillagers.
Expected result
The pillagers attack the villager.
Actual result
Results vary!
Sometimes the pillagers attack the villager.
Sometimes the pillagers load their crossbows then aim at the villager and freeze.
Sometimes the pillagers ignore the villager.
Note
It is possible to reproduce this in survival with the pillagers targeting the player, but it's easier to do with villagers in creative.
Test world
The attached test world contains a repeating command block that teleports all pillagers to a central spot for testing. The command block can be turned on or off with the lever to allow the pillagers to stand on their own 2 feet. The named pillager captain already present had spawned naturally and had previously attacked villagers and wandering traders that were then killed by the player. The pillager's shooting range is roughly marked out with stone.
Original summary
Pillager followers don't attack until it goes far away
Original description
vindicator patrol captain attacks a villager but the pillager will not attack if its not far away to attack the villager, pillagers have issues with behavior when its following a vindicator captain however pillager still charges its crossbow when a villager is nearby since vindicators don't look at villagers unlike pillagers does.
Linked issues
relates to
Attachments
Comments


Affect Java as well, when you spawn a pillager near a iron golem during raid, it runs away and comes back

Spencer: please create a new report in the Java project.

Affects 1.16.221
Forgot to replace that other person?

This is also an issue with players, if I lock myself in a small place in survival then spawn a patrol captain, that patrol captain becomes completely neutral towards me and won't attack me until I either let the pillager out or hit it.

This was fixed along with MCPE-116971 in 1.19.10. The test world will not show the fix with the pillager that is already there when you load it because that pillager was spawned in a previous version. You can observe the fix with new pillagers.
I think this is a problem with how the
[media][media]hold_ground
behavior is situated within the pillager's entity structure. In the videos below, you can see that when I let the pillager out of its holding cell it first wanders away from the villager, and then it stops and holds ground indefinitely. It only attacks the villager in the second video after I push the villager toward it.This can be explained by the facts that
The pillager's
attack_radius
forranged_attack
is 8The pillager's
min_radius
forhold_ground
is 10Patrol pillagers spawn without any attack behavior and can only gain an attack behavior by first holding ground.
Whenever a target escapes from a pillager, the pillager loses its attack ability via the
calm
event.Together these facts mean that a patrol pillager cannot attack any mob unless it first targets that mob at > 9 blocks and then the mob moves toward the pillager.