Not taking any damage

So I’m playing on a server, a player lags through the wall at the jungles and needs their body back. So I turn on god mode and 1000 move speed, I run all the way there only to launch myself off a ledge and fly through it myself and die. After I get my body back by flying over the wall and come back I notice I no longer take damage from mobs after turning god mode and everything back off.