Spamming left-click as a spectator shoots the player into the air
using latest commit. spamming left-click as a spectator causes the spectator to get forcefully blasted upwards into the air and makes it difficult to stop flying. pulling this off can be inconsistent, but it does happen. the only way to stop getting pushed upwards is to teleport to another player using the hotbar. i don't know if this glitch applies to every single type of spectator mob. i'll try to get a video of this in action later
update: i'm unable to replicate this
This happens because you spectate the bat that is following you. Teleporting behind you, creating a loop.
its been known for a while, ive had some occasional ideas for a fix, but it would take a lot of work
im currently waiting to see if mojang adds /transform to vanilla, if they do the entire spectator system is likely to get reworked and using /transform it shouldnt occur
mojang doesnt seem to want to do this apparently, an alternate solution might be worth looking into