Fix for /setworldspawn

Good afternoon, I recently found out about how /setworldspawn ignores y-value on survival mode and was wondering about a datapack implementation to circumvent this on a modded server. I was thinking about setting server gamemode to adventure and then running a check everytime a player joins or dies that would put them into survival mode. Is this feasible, and if not is there a better way. Thank in advance.
Continue to help post