This issue has been present on previous versions however a spectate command was not present before 1.15 so it only became an official issue now that 1.15 was released.
When you select an entity to spectate that's far away, for example with the following command.
/spectate @e[limit=1,sort=furthest]
This will only teleport you to the entity. The game still thinks you are spectating this entity however! If you sneak to exit spectating mode it will teleport you back to the entity because the game thinks you're first person spectating the entity in question even when you're not.
On a server the effect is even worse as it triggers multiple "Moved too quickly" warnings then teleports the client to the entity causing a huge lag spike.
This does not occur on nearby/loaded entities.
- duplicates
-
MC-163266 When the target in /spectate command is too far, the player's movement will not be restricted at client-side
- Resolved