mojira.dev
MC-279556

The "/execute on attacker" command does not target an entity previously targeted by the "/data" command

/execute on attacker will not work if the entity has been previously targeted by the /data command that tick. This problem does not exist in version 1.21.4.

To reproduce:

  1. /tick freeze
  2. /summon iron_golem
  3. Punch the iron golem

  4. /execute as @n[type=minecraft:iron_golem] on attacker run say yes

    ✔ You say "yes"

  5. /data get entity @n[type=minecraft:iron_golem]
  6. /execute as @n[type=minecraft:iron_golem] on attacker run say yes

    ❌ Nothing is output

 The above situation can also lead to errors in datapacks and command blocks.

Linked issues

Attachments

Comments 2

can confirm, also happens with targets selected by a target selector with the nbt= parameter. Also affects 25w04a. Relates to MC-279543, a similar (but not duplicate) bug that I reported myself.

Plants_Stars

etanaratsastaja

Confirmed

Platform

Important

Commands

25w02a, 25w03a, 25w04a

25w05a

Retrieved