The bug
When a NoAI
entity is teleported downwards, while the player is outside of the entity view distance, and the player enters that distance while the entity is still teleported, the entity may end up displayed at the wrong position
I assume that there is some mismatch being created between what the client thinks where the entity is located at, and where the entity is actually located at. Once the server updates the entity's position on the client to its absolute coordinates (for example by leaving and re-entering the tracking range another time), the entity appears at the correct position.
How to reproduce
Summon a villager with the following command:
/summon minecraft:villager ~ ~ ~ {NoAI:true,Tags:["MC-130725"]}
Put down a repeating command block with following command and activate it:
execute as @e[tag=MC-130725] at @s if block ~ ~-0.5 ~ minecraft:air run tp @s ~ ~-0.5 ~
Execute following command in chat:
/execute as @e[tag=MC-130725] at @s run tp @s ~ ~50 ~
→ ✔ The villager will be teleported downwards until he is standing directly above the block, as expected
Now go far enough away from the villager that he is no longer rendered
Execute the command again in chat
Enter the render distance while the villager is still being teleported downwards
→ ❌ The villager may appear as if he was inside of the block
Comments 7
I just rebuild the reproduction contraption I outlined above and am still able to reproduce this on 1.14.4. I haven't tested this on MC 1.15 yet.
Since my description of the issue / how to reproduce this with the outlined command block contraption might be confusing, I made a quick video of this and uploaded it here: https://www.youtube.com/watch?v=AUhcTnryQds (or if that link doesn't work, alternatively here: https://oc.h-in-t.net/nocloud/index.php/s/voXdVOtKBcyBtCn)
This contraption actually moves the villager 21 blocks this time, and directly teleports the villager back to the original height at the start of the next cycle. The video also shows the commands updated for 1.14.4. The first demonstration at 1:40 already perfectly shows how the villager appears to be inside the orange block, even though the output of the last teleport command reports that the villager got correctly teleported to y=6. (Though, with the video quaIity on youtube it might be harder to see than it actually is when playing the game; but the ones at 2:21, 2:25, and 2:42 should be visible nevertheless)
Still affects both 1.15.2 and 20w17a.
I tested it in both versions after encountering it in 1.15.2.
The Entity Distance setting in 20w17a does not seem to affect it. The glitch only occurs when the player goes far enough away for the entity to stop rendering at Entity Distance = 100% (even while Entity Distance is set to 50% or 75%).
Still affects 20w18a, though less often.
It happens frequently at Entity Distance 100% and Render Distance >=18. It can happen at Entity Distance 50% and Render Distance 10, but much less often. I haven't seen it happen at Entity Distance 100% and Render Distance <18.
Still affects 20w20b.
This glitch also occurs if the player is killed while the NoAI entity is being teleported.
To reproduce:
Set your spawn point near the @e[tag=MC-130725] villager.
Run the first three reproduction steps listed in the bug report above.
Execute /kill as the entity is being teleported downwards.
--> ❌ The villager may appear as if it is inside a block.
Please check if that's still an issue for you in the latest 1.14.4 stable release or the latest 1.15 development snapshot.