The most likely situation you're in is that you have set a spawnpoint for yourself. Even if you set the world spawn in the nether or the end you will respawn in the overworld.
To check if you have a spawnpoint set you can use the command:
data get entity @s
Then look at the end of your chat to find SpawnX
, SpawnY
& SpawnZ
they will have your spawnpoint coordinates.
If you have set your spawn point with a bed or anchor, you can reset your spawnpoint by destroying the bed or anchor and then run /kill
or any other way. If you used the spawnpoint
command you have to use a bed or anchor first. You'll get the message "You have no home bed or charged respawn anchor, or it was obstructed"
. Then you can check for the spawn data again.
You can run this command so you don't need to look through the chat:
/data get entity @s SpawnX
This will give only the x coordinate, if you get a number you have a spawn but if you get the message: "Found no elements matching SpawnX"
then you will spawn at the world spawn.