Jump to content

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

1 reply to this topic

#1 luochen1990

  • Members
  • 31 posts

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" / ...

#2 Luca_S

  • Members
  • 407 posts
  • LocationGermany

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.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users