Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-137427

Advancements treat the player as the "direct_entity" source of primed TNT damage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.13.2, 1.15.2, 20w08a, 1.16.4, 1.16.5, 21w15a
    • Confirmed
    • Advancements

      When a player damages or kills an entity by igniting TNT, advancements should get a minecraft:player_hurt_entity and/or minecraft:player_killed_entity trigger, with the "direct_entity" set to the primed TNT in question and the "source_entity" set to the player that lit it.

      Instead, the "direct_entity" is always set to the player. Every other way the player has of damaging targets at a distance while giving the player credit (arrows, tridents, snowballs, eggs, splash/lingering potions of harming) sets the "direct_entity" to the correct target.

      To test this:

      • Add the attached data pack to a world. It prints a message when the player hurts or kills an entity, and an additional message if the "direct_entity" is the player or a primed TNT.
      • Hurt/kill an entity with your fist, and note that the "direct_entity" is correctly set to the player.
      • Hurt/kill an entity with a non-TNT projectile, and note that, since we receive no second message, the "direct_entity" is correctly not set to the player (nor, for some reason, to a primed TNT).
      • Hurt/kill an entity by lighting TNT with a flint and steel, and note that the "direct_entity" is incorrectly set to the player.

            Unassigned Unassigned
            AjaxGb AjaxGb
            Votes:
            11 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: