Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-256071

@s Distance Selector Overrides Dimension

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.19.2
    • OS: Windows 11
      Java: 17.0.4
    • Unconfirmed
    • (Unassigned)

      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.

            Unassigned Unassigned
            lesamuen lesamuen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: