Cross-dimensional @s selector succeeds despite world-binding parameters
The bug
World-binding selector arguments x y z dx dy dz distance will restrict selector results to entities in the dimension the command context is executing from. However @s is not restricted, and it will be found regardless of the presence of world-binding arguments if the sender dimension differs from the context dimension.
How to reproduce
- Enter the overworld.
- /execute in the_nether unless entity @a[x=0]
→
Test passed - /execute in the_nether unless entity @s[x=0]
→
Test failed, count: 1
Linked Issues
Created Issue:
Cross-dimensional @s selector succeeds despite world-binding parameters
Environment
The bug
World-binding selector arguments x y z dx dy dz distance will restrict selector results to entities in the dimension the command context is executing from. However @s is not restricted, and it will be found regardless of the presence of world-binding arguments if the sender dimension differs from the context dimension.
How to reproduce
- Enter the overworld.
- /execute in the_nether unless entity @a[x=0]
→Test passed
- /execute in the_nether if entity @s[x=0]
→Test failed, count: 1
The bug
World-binding selector arguments x y z dx dy dz distance will restrict selector results to entities in the dimension the command context is executing from. However @s is not restricted, and it will be found regardless of the presence of world-binding arguments if the sender dimension differs from the context dimension.
How to reproduce
- Enter the overworld.
- /execute in the_nether unless entity @a[x=0]
→Test passed
- /execute in the_nether unless entity @s[x=0]
→Test failed, count: 1
The bug
World-binding selector arguments x y z dx dy dz distance will restrict selector results to entities in the dimension the command context is executing from. However @s is not restricted, and it will be found regardless of the presence of world-binding arguments if the sender dimension differs from the context dimension.
How to reproduce
- Enter the overworld.
- /execute in the_nether unless entity @a[x=0]
→Test passed
- /execute in the_nether if entity @s[x=0]
→Test failed, count: 1
is duplicated by
is duplicated by
is duplicated by
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.
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.
Confirmed in 1.16 Pre-release 5.
1.16.1
This also applies to @a
So if you use some kind of coordinate restriction the dimension context is applied but if you dont then it will select players from any dimension.
tellraw @a "hello" tells everyone in all dimensions as you would expect
but so does this even though you would expect it to just apply to the named dimension:
execute in pw:spleef run tellraw @a "hello"
whereas this next one correctly restricts the dimension:
execute in pw:spleef run tellraw @a[x=0,y=50,z=0,distance=..500] "hello" - just tells players in the spleef dimension
this feels incorrect and means you have to test nbt data unnecessarily
Also applies to @e.
so execute in aworld run kill @e[type=item] takes no notice of being in 'aworld'
You need to include worldbinding parameters to restrict most selectors to the target dimension. That is intended. The problem is that worldbinding parameters do not restrict @s
From what i can see world binding doesn't restrict anything (@a, @s or @e) unless you put coords
This is counter intuitive. As I mentioned before:-
execute in aworld run kill @e[type=item] takes no notice of being in 'aworld' and kills any item in any dimension
the only way you can restrict this is with
{Dimension:"mydimension"}@e[type=item, nbt=
]
which is very heavy on processing
Yes, coords are worldbinding parameters. You should use them (like the simple @a[x=0] in the example) instead of the expensive NBT check (which no longer works because only players save their dimension to NBT now)
Are you saying kill @e[type=item, nbt=
{Dimension:"mydimension"}] will no longer work? It works fine at 1.16.1.
it doesnt make sense though that specifying the dimension with execute in mydimension doesnt bind the dimension for anything that follows
Try this:
/kill @e[nbt={Dimension:"minecraft:overworld"}]Notice how it will only kill you, the player, and not any other mobs.
All commands run in a single particular dimension. If all selectors were restricted to the dimension of the command, it would be impossible to select everything at once. Hence, by default selectors select everything, and we can restrict them with worldbinding parameters.
Again, please don't confuse this report with anything to do with selectors other than @s. All other selectors are working perfectly as intended.
Confirmed in 1.16.3.
Can confirm in 20w49a.
Can confirm in 21w03a.
Can confirm in 21w06a.