This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
luochen1990's profile picture

How to detect which dimension & world my turtle is inside?

Started by luochen1990, 25 March 2020 - 05:22 AM
luochen1990 #1
Posted 25 March 2020 - 06:22 AM
Hello guys, I'm now writing a program using rednet to control turtles, and now I need to detech which dimension & world my turtle is inside, so that they can avoid to abuse the coordinate information in the other world.

Is there some mechanism to implement a function like following ?


local result = detectWorld()
print(result.dimensionName)  -- "overworld" / "the nether" / "the end"
print(result.worldName) -- "world" / "DIM1" / ...
Luca_S #2
Posted 25 March 2020 - 08:17 AM
AFAIK there is no builtin way to do that. You could however do something similar to the GPS program and have a server in each dimension responding to PINGs with the dimension it's in(Or patch that into the already existing GPS Program).

Because the modem_message event doesn't provide a distance if the message is coming from another dimension you can determine which response came from a server within your current dimension.