mojira.dev
MC-71426

Arrows visually despawn when kept from despawning with command blocks

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.

Linked issues

Attachments

Comments

Aaron Rhodes

It visually disappears after it would normally reach a life of 1200, which is when the arrow despawns.
Are you trying to make anything special with this?

if you fire the arrow at a repeater in a redstone loop/clock, the arrow will not visually disappear, so the glitch might have to do with updating the position,rotation,or motion of the arrow.

kumasasa

Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.

AjaxGb

@unknown Just tested in 1.10.2 and 16w43a, the bug still exists with no changes.

AjaxGb

Confirmed for 1.12.2 and 1.13-pre5.

Swekob

Is this issue in 1.14.4 or 1.15-pre1?

AjaxGb

 I was unable to reproduce in 1.15.2. Seems to be resolved.

AjaxGb

(Unassigned)

Confirmed

(Unassigned)

arrow

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

1.15.2

Retrieved