mojira.dev
MC-256071

@s Distance Selector Overrides Dimension

When using @s with the target selector distance, the dimension used for the distance selector seems to be overwritten by the @s selector.

For example,

execute positioned as @s in minecraft:overworld if entity @s[distance=0] run say "I'm in the Overworld!"

and

execute positioned as @s in minecraft:the_end if entity @s[distance=0] run say "I'm in the End!"

both run if you are in either the End or Overworld.

 

Curiously, dimensional coordinate systems are still in effect;

execute positioned as @s in minecraft:the_nether if entity @s[distance=0] run say "I'm in the Nether!"

only works in the Nether, probably because of the coordinate conversion.

 

I was doing this to obtain the dimension of mobs (by executing as the mobs using a data pack function) since the Dimension nbt for them has been removed since 1.16.

A temporary workaround is using @e instead of @s for the second selector, but that comes with the side effect of possibly detecting other entities that just happen to be in the exact same position in a different dimension, and probably being a more resource intensive command.

Environment

OS: Windows 11
Java: 17.0.4

Linked issues

Comments 1

Thank you for your report!
We're tracking this issue in MC-133579, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

migrated

(Unassigned)

Unconfirmed

command

1.19.2

Retrieved