I want to check a player's current dimension using a scoreboard. For example, if a player is in the overworld, scoreboard
would be set to 1. Nether would be 2. And the End would be 3.
I have tried execute if entity @a in minecraft:the_nether
but that actually changes the coordinate's dimension.
Do you know any way to detect a player's current dimension?
Best Answer
It's saved in NBT. Quote from the Minecraft wiki (archive):
Alternatively, you could still use
/execute in
, but also check for a radius of 0 or more (which sounds useless, but can be used as a dimension check):This executes if there is a player in the Nether.
There is also an advancement trigger called "
changed_dimension
" (archive) that can be used to detect a change to a specified dimension and trigger something at that moment. Alternatively you could use thedimension
field in thelocation
trigger (archive).