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

Arrows visually despawn when kept from despawning with command blocks


    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.15.2
    • Minecraft 1.8, Minecraft 1.8.8, Minecraft 15w47c, Minecraft 1.10.2, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11.2, Minecraft 1.12.2, Minecraft 1.13-pre5, Minecraft 1.13.1
    • Confirmed
    • (Unassigned)

      The bug

      I used command blocks to constantly set all arrows' life data tag to zero, keeping them perpetually young. I expected that this would stop them from despawning, and it did, but arrows still turn invisible after one minute. Reloading the chunks does nothing. Closing the world and reopening it makes arrows visible for another minute.

      How to reproduce

      1. Set up a repeating command block using the command below to keep arrows from despawning
        /execute as @e[type=arrow] run data merge entity @s {life:0s}

        Optionally, you can also have it run the command below to show that the arrows are still there

        /execute at @e[type=minecraft:arrow] run particle minecraft:happy_villager ~ ~ ~ 0 0 0 0 0
      2. Fire some arrows
      3. Wait one minute for arrows to turn invisible
      4. Test that they are still there (they can be picked up, targeted in commands, etc)

      Code analysis

      Based on 1.13.1 decompiled using MCPConfig.

      It appears the underlying problem is that the client destroys the entity. Usually only the server should destroy the entity and then inform the client about this.

      While in this case sending the life value to the client would solve this specific problem, it would not solve other problems caused by the above described situation, for example when the client incorrectly thinks the arrow is ground, destroying it after a certain amount of time.

        1. 2014-09-08_11.12.02.png
          255 kB
        2. 2014-09-08_11.12.13.png
          284 kB
        3. 2014-09-08_11.13.11.png
          238 kB
        4. 2014-09-08_11.13.25.png
          235 kB

            Unassigned Unassigned
            AjaxGb AjaxGb
            9 Vote for this issue
            6 Start watching this issue