mojira.dev
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.

Attachments

Comments 1

This has been fixed in 1.20.5 pre-release 1:

image-20261101-133530.png

migrated

(Unassigned)

Confirmed

Platform

Low

Data Packs

data-pack, datapack, hoglin, targeted-entity, zoglin

20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 3, , 1.17.1 Pre-release 1, 1.17.1, 21w39a, 21w41a, 21w42a

1.20.5 Pre-Release 1

Retrieved