Steps to reproduce
/summon vindicator ~~~ minecraft:promote_to_patrol_captain
/summon pillager ~~~ minecraft:promote_to_patrol_captain
/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
relates to 2
Comments 4
Another special case of MCPE-48587
This bug is a consequence of the following:
The vindcator's targeting behavior components are only given within its
minecraft:default_targetingandminecraft:vindicator_johnnycomponent groups. Likewise, the pillager's ranged attack behavior component is only given within itsminecraft:ranged_attackcomponent group.The vindicator's
minecraft:default_targetinggroup is only added by theminecraft:stop_johnnyandminecraft:entity_spawnedevents. Likewise, the pillager'sminecraft:ranged_attackcomponent group is only added by itsminecraft:entity_spawnedandminecraft:ranged_modeevents.Running a
/summoncommand with an event argument causes the defaultminecraft:entity_spawnedevent to be skipped. So in this case,/summon vindicator ~~~ minecraft:promote_to_patrol_captainor/summon vindicator ~~~ minecraft:promote_to_illager_captainor/summon vindicator ~~~ minecraft:spawn_as_illager_captainspawns 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
/summonbehavior here is a bug or not, but the particular issue with captains could easily be fixed by copying the vindicator's targeting behavior from itsdefault_targetinggroup, and the pillager's ranged attack behavior from itsranged_attackgroup, into their respective "components" sections. That's exactly how theminecraft:buoyantcomponent 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.