how can i make a function that runs every time the player spawns

i have been trying to make a zombie origin for the origins mod and made the player catch on fire when under the sun i wanted to add a safe period on spawn, but i have no idea how to make that condition

i can send a pic of the code if needed actually, here it is

Continue to help post