I have a vanilla server 1.8.7 that uses a book to tp players to spawn or to their home (an invisible armor stand with their uuid connected to it). Problem is, if they set home (place their armor stand) in the overworld and go to the nether and try to tp home (activated using a trigger), it sends them to the same co-ordinates in the nether, and most likely kills them.
I did some digging, and there seems to be a dimension parameter, but I can't quite figure out the syntax or how to get it to work.
I updated the command block to:
/tp @a[score_tpHome_min=1,Dimension=0] 68 68 68
I was hoping it would only tp the player when they were in the overworld (Dimension 0), but it seems to be ignoring that parameter in the nether and still teleporting to those co-ordinates in the nether.
I also tried:
/tp @a[score_tpHome_min=1,Dimension:0] 68 68 68
Which is the way other people were using the parameter in other ways, but that gave an error.
Best Answer
This is almost a version of @MrLemon's answer. Run the following command once:
Put the following commands on a fill/fast clock:
Then do the tp as following:
How this works is it gets the player dimension by setting the scoreboard objective
Dimension
to the dimension that they are in.