Mojira Archive
MC-186013

"targeted_entity" in predicates does not work for Hoglins and Zoglins

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

  1. Install the data pack below in a world for easier reproduction.
  2. Use the following command to give yourself a customized Name Tag:
    /give @s name_tag{display:{Name:'{"text":"targeted_entity","italic":false}'}}
  3. 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.
  4. 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.