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

Projectiles are rendered incorrectly if their Motion tag was recently changed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 18w45a, Minecraft 18w46a, 1.20.1, 23w33a, 24w14a, 1.21, 1.21.2 Pre-Release 3, 1.21.3
    • None
    • Confirmed
    • Commands, Projectiles
    • Normal
    • Platform

      The bug

      NOTE: This is not a duplicate of MC-124197 or any bugs listed within. This is new as of the 1.14 snapshots. It didn't occur in 1.13.2.

      It affects all projectile entities (e.g. arrows, fireballs, potions, enderpearls, snowballs, eggs, etc.) but not other entities such as tnt or mobs. Every ~20 ticks it updates the position to where it's supposed to be, and if the entity changes state (such as an arrow's inGround tag becoming true) it updates immediately. It also affects other entities properly even while not being rendered in the correct location. For the Power[0,1,2] data, the projectile renders with a trajectory that curves towards the negative X, Y, and Z directions but actually travels and impacts as it should.

      A video's worth a thousand pictures, so here's a video showing the bug in action

      Video demonstration

      In case you need more details, this is using a convoluted raycasting system I set up. The projectiles are being fired in the direction of an invisible armorstand summoned 0.1 blocks in front of the player by setting the Motion or Power tags equal to the difference between the coordinates of the armorstand and the player, stored as a scoreboard value, via /data merge. When I summon them regularly with a /summon command such as /summon minecraft:fireball ~ ~ ~ {direction:[0.0,0.0,0.0],power:[0.123,-0.123,0.246]} they render just fine. As far as I can tell, it only occurs with /data merge. I'm not sure if it only affects /data merge with the "from" argument, or all /data merge commands.

      How to reproduce

      1. Enter the following commands into active repeating command blocks:
        /summon snowball ~ ~1 ~ {Motion:[1.0,1.0,0.0]}
        /execute as @e[type=snowball,tag=!edited] run data merge entity @s {Motion:[0.0,1.0,1.0],Tags:[edited]}

        The newest snowballs appear to travel the wrong direction

            Unassigned Unassigned
            TheRedstoneBlaze Ethan Maness
            Votes:
            18 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              CHK: