When one sleeps and skips night they reset their spawn.
Does lying in a bed but not skipping the night reset their spawn?
Yes. There is no need to actually stay in the bed. All that matters is that you actually were laying down. So rightclicking on a bed and getting the message “you can only sleep at night” does not set your spawn. Getting in the bed, and immediately back out sets your spawn.
Source : Link , Question Author : Meta , Answer Author : Arperum