I'm having trouble with commandblocks, so here is what I want to do: I want to create a system that teleports you away upon eating bread. I know how to test for a player who is eating the bread using:
/scoreboard objectives add Eat stat.useItem.minecraft.bread /testfor @a[score_Eat_min=1] /scoreboard players set @a[score_Eat_min=1] Eat 0
That part for me is easy, but I also want to add a feature that you won't be teleported away if you are moving, or moving after you have eaten the bread. This part I do not know how to create with commandblocks. I want this only to happen for the player who ate the bread and not that it will count the movements of other players.