mojira.dev
MCPE-116971

Patrol/illager captains don't attack when spawned by commands

Steps to reproduce

  1. /summon vindicator ~~~ minecraft:promote_to_patrol_captain

  2. /summon pillager ~~~ minecraft:promote_to_patrol_captain

  3. /summon villager

Expected result

The illagers attack the villager

Actual result

The vindicator ignores the villager. The pillager charges its crossbow but never attacks.


Last time when a vindicator patrol captain naturally spawned, they were hostile 

when spawned by commands they are neutral, this is really weird seeing them not attacking and it confuses me, and vindicator followers are always hostile 

vindicator patrol captains have behavior issues

Expected Result: Vindicator patrol captains should be hostile

Observed Result: They are Neutral

Reproduce Steps:

1. wait for a vindicator patrol captain spawned 

2. spawn a villager 

3. spawn a vindicator patrol captain with a command 

4. spawn a villager

see that it won't attack

Linked issues

Comments

GoldenHelmet

This bug is a consequence of the following:

  1. The vindcator's targeting behavior components are only given within its minecraft:default_targeting and minecraft:vindicator_johnny component groups. Likewise, the pillager's ranged attack behavior component is only given within its minecraft:ranged_attack component group.

  2. The vindicator's minecraft:default_targeting group is only added by the minecraft:stop_johnny and minecraft:entity_spawned events. Likewise, the pillager's minecraft:ranged_attack component group is only added by its minecraft:entity_spawned and minecraft:ranged_mode events.

  3. Running a /summon command with an event argument causes the default minecraft:entity_spawned event to be skipped. So in this case, /summon vindicator ~~~ minecraft:promote_to_patrol_captain or /summon vindicator ~~~ minecraft:promote_to_illager_captain or /summon vindicator ~~~ minecraft:spawn_as_illager_captain spawns a vindicator captain with no targeting behavior component. Likewise, pillagers spawned with those events have no ranged attack behavior component (except for spawn_as_illager_captain, which adds ranged_attack, probably as the fix for MCPE-44987).

I am not sure if the /summon behavior here is a bug or not, but the particular issue with captains could easily be fixed by copying the vindicator's targeting behavior from its default_targeting group, and the pillager's ranged attack behavior from its ranged_attack group, into their respective "components" sections. That's exactly how the minecraft:buoyant component is set up in the boat.json entity file, for example--it's in the "components" section as a default and also in a component group so that it can be added and removed when needed.

However, copying these components into the main "componenets" sections ruins the patrol pillagers' "hold_ground" behavior. On the other hand, that behavior has its own problem, MCPE-117328.

tryashtar

Another special case of MCPE-48587

SlimySpeck

I'll become a new reporter? Need to add affected versions for it since he is no longer active

SlimySpeck

Affects 1.17.0.54 Beta spawning a Vindicator captain with commands creates a broken and corrupted mobs usually a parity bug 

Whoops! you got the wrong reporter there, my Username was called SlimySpeck

He has no status in his profile and won't update the report

SlimySpeck

(Unassigned)

473966

Confirmed

Multiple

1.19.10.20 Preview, 1.18.33 Hotfix, 1.18.32, 1.18.30.22 Beta, 1.18.20.27 Beta, ..., 1.17.41 Hotfix, 1.18.0, 1.18.2 Hotfix, 1.18.12 Hotfix, 1.18.31

1.19.10.22 Preview, 1.19.10

Retrieved