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

Inconsistent behavior of target selector arguments "dx", "dy" and "dz"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.12.2, Minecraft 17w50a, Minecraft 18w16a, Minecraft 1.13.2, Minecraft 19w06a, Minecraft 1.14.1, 1.14.4, 19w35a, 19w41a, 19w42a, 19w44a
    • Fix Version/s: None
    • Labels:
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      The volume defined by target selector arguments "dx", "dy" and "dz" is always larger than specified by 1 in all dimensions.
      For example, "@e[dx=0,dy=0,dz=0]" would select entities 1 block in front of the player (in +x, y, z direction), "@e[dx=1,dy=1,dz=1]" would select entities 2 blocks in front of the player (in +x, y, z direction), etc.

      In 17w50a, it is allowed to use negative values and is accurate in - x,y,z direction. However, the volume would extend by +1 in all dimensions relative to the execution coordinate.
      For example, let (x, y, z) be the player's coordinate, A be an entity at (x+1, y, z), B be an entity at (x-1, y, z).
      "@e[dx=-1]" would select the player and entity A and B, "@e[dx=-0.5]" would select the player and entity A, which both of them should not select entity A.

      How to reproduce

      1. Setup some armor stands
        /summon armor_stand ~ ~ ~ {CustomName:'"center"',NoGravity:1b}
        /execute at @e[type=armor_stand,name=center] run summon armor_stand ~1 ~ ~1 {CustomName:'"positive"',NoGravity:1b}
        /execute at @e[type=armor_stand,name=center] run summon armor_stand ~-1 ~ ~-1 {CustomName:'"negative"',NoGravity:1b}
        
      2. Use the following command
        /execute at @e[type=armor_stand,name=center] run say @e[dx=0,dy=0,dz=0]
        

        It finds the "positive" armor stand even though it should not

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pca006132 john
              • Votes:
                30 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: