How to set the world spawn to a player?

Solution 1:

In a repeating command block, use the command:

execute at <player identifier> setworldspawn ~ ~ ~