Im new in making datapacks but, All im trying to do is make it detect when im in the minecraft:nether_1. So if im in the nether it will run the command "execute as @a at @s in minecraft:nether_2 run tp @s ~ ~ ~"

  • I still have no idea what you mean with "nether_2". This does not exist in Minecraft Vanilla. – Fabian Röling Jan 12 at 17:15

There is an advancement condition called location that can check for dimension.

In commands you can read out the "Dimension" field in NBT:

/say @a[nbt={Dimension:-1}]

This tells you all players in the Nether. 0 is Overworld, 1 is End.

It might give you slightly better performance to use this workaround:

/execute in the_nether run say @a[distance=0..]

With that, the game doesn't need to read any NBT and can use its already existing lists of players per dimension.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.