mojira.dev
MCPE-117328

Patrol pillagers do not consistently attack

Steps to reproduce

  1. In creative mode, wait for a pillager patrol to spawn naturally.

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

Attachments

Comments

GoldenHelmet

I think this is a problem with how the 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.

[media][media]

This can be explained by the facts that

  • The pillager's attack_radius for ranged_attack is 8

  • The pillager's min_radius for hold_ground is 10

  • Patrol 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.

SlimySpeck

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

osfanbuff63

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

SlimySpeck

Affects 1.16.221 

Forgot to replace that other person?

CallMeChris

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.

GoldenHelmet

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.

SlimySpeck

(Unassigned)

476662

Confirmed

Multiple

1.19.30.22 Preview, 1.18.20.21 Beta, 1.18.10.24 Beta, 1.18.10.22 Beta, 1.18.10.21 Beta, ..., 1.17.41 Hotfix, 1.18.0, 1.18.2 Hotfix, 1.18.31, 1.19.20

1.19.10

Retrieved