The bug
Using the targeted_entity parameter in an entity_properties predicate condition does not work for Hoglins and Zoglins. The parameter can be used with other mobs without issues.
Here are examples of affected predicates:
{
"condition": "entity_properties",
"entity": "this",
"predicate": {
"type": "hoglin",
"targeted_entity": {}
}
}{
"condition": "entity_properties",
"entity": "this",
"predicate": {
"type": "zoglin",
"targeted_entity": {}
}
}How to reproduce
Install the data pack below in a world for easier reproduction.
Use the following command to give yourself a customized Name Tag:
/give @s name_tag{display:{Name:'{"text":"targeted_entity","italic":false}'}}Use the customized Name Tag on a different mob such as a Zombie, and then make it attack another mob.
→ ✔ That mob shows dust particles.Use the same Name Tag on a Hoglin or Zoglin, and then repeat the same procedure.
→ ❌ The Hoglin or Zoglin does not show dust particles.
This has been fixed in 1.20.5 pre-release 1: