Assembling a ship and right clicking to “pilot” it locks player in place and they cannot move / interact with the environment / steer the ship or sneak to get out.
The best way I can describe it is if you got a repeating command block to repeatedly teleport you to a location over and over again, you can move around barely until your immediately teleported back again.
image.png
image.png