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

Changing the "Owner" tag of a projectile doesn't affect the outcome of the projectile unless the world is reloaded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20 Pre-release 2
    • 21w20a, 1.17 Pre-release 1, 1.17 Pre-release 2, 1.17 Pre-release 3, 1.17 Pre-release 4, 1.17 Release Candidate 2, 1.17, 1.17.1, 21w37a, 21w43a, 1.18 Pre-release 2, 1.18, 22w19a, 1.19.2, 22w44a, 1.19.3, 23w05a
    • None
    • Confirmed
    • Commands
    • Normal

      The bug

      The Owner tag of projectiles (arrows, snowballs, eggs, tridents, ender pearls, etc.) determines which mob/player the target mob becomes angry at when it is hit by a projectile. The Owner tag is also used by ender pearls to determine which mob/player to teleport when an ender pearl lands. Datapacks sometimes change the Owner tag of projectiles. In 1.16.5, this works properly. However, now, changing the Owner tag of projectiles does not have any effect until the world is reloaded.

      To reproduce

      Ender Pearl Teleportation

      1. Spawn a mooshroom.
      2. Throw an ender pearl straight up.
      3. Before the ender pearl lands, run the below command:
        /data modify entity @e[type=minecraft:ender_pearl,limit=1,sort=nearest] Owner set from entity @e[type=minecraft:mooshroom,limit=1,sort=nearest] UUID
      4. Wait for the ender pearl to land. Notice that you are teleported instead of the mooshroom.
      5. Repeat steps 1-4, but this time, exit and reload the world in between steps 3 and 4. This time, when the ender pearl lands, the mooshroom is teleported instead of you.
      6. Optional: Repeat steps 1-4 in 1.16.5. The mooshroom is teleported even though you didn't reload the world.

      Neutral Mob Aggravation

      1. Spawn a polar bear.
      2. Spawn a mooshroom.
      3. Put the below command into a repeating command block:
        /execute at @e[type=minecraft:polar_bear] run data modify entity @e[type=minecraft:snowball,distance=..20,limit=1,sort=nearest] Owner set from entity @e[type=minecraft:mooshroom,limit=1,sort=nearest] UUID
      4. Switch to survival mode.
      5. Throw a snowball at the polar bear.
      6. The polar bear attacks and kills you instead of the mooshroom.
      7. Throw a snowball at the polar bear again, but this time, exit and reload the world before the snowball hits the polar bear. The polar bear attacks and kills the mooshroom.
      8. Optional: Repeat steps 1-6 in 1.16.5. The polar bear attacks the mooshroom even though you didn't reload the world.

            slicedlime [Mojang] slicedlime
            pine1needle [Helper] pine1needle
            Votes:
            26 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: