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
- 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
- Fire some arrows
- Wait one minute for arrows to turn invisible
- 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.
- is duplicated by
-
MC-67521 Disappearing Arrows
- Resolved