How to prevent sufficating in blocks

kinda working on something when you have telekenisis and I want to be able to hold mobs in the air so I have a raycasting that finds the mob and than I do like tp ^ ^ ^5 how can I prevent abuse to kill mobs and players in blocks I tried using rotate but if the player fast enough he can get it
Continue to help post