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

Arrows have their motion reset when hitting a block

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 24w45a
    • None
    • Confirmed
    • (Unassigned)

      In previous versions (tested in 1.21.1), arrows that were shot into a block would stop moving but preserve their Motion nbt data. Now, arrows have this data reset to [0.0d, 0.0d, 0.0d]

      This breaks custom datapacks which try to manipulate arrows just before or on the same tick they collide with a wall, since datapacks can't detect the inGround nbt on an arrow until the tick after it hits a wall.

      Steps to observe this behavior:
      1) Download the attached datapack and load it in any 24w45a world
      2) Run the command /tick freeze
      3) Shoot an arrow at a wall
      4) Repeatedly run these commands in order

      /tick step
      /data get entity @n[type=arrow] inGround
      /data get entity @n[type=arrow] Motion 

      5) Notice how the sound of the arrow hitting the wall and the inGround data of the arrow can be observed 1 tick before the datapack runs a say command in chat

       

      The attached screenshots are both examples of in ground arrows, in 1.21.1 the arrow still has motion data while in 24w45a the arrow has reset motion data.

       

        1. 1.21.1.png
          1.21.1.png
          110 kB
        2. 24w45a.png
          24w45a.png
          108 kB
        3. arrow-inground-demo.zip
          2 kB

            Unassigned Unassigned
            Strongis13 Strongis13
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: