Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-174949

Target selector volume arguments "dx", "dy" and "dz" select larger area than provided

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.40.20 Preview, 1.20.15 Hotfix, 1.20.50.22 Preview, 1.20.50.21 Preview, 1.20.40
    • None
    • Confirmed
    • Multiple
    • 1124689

      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 in a 1x1x1 cube with the negative corner at the execution location, and @e[dx=1,dy=1,dz=1] would select entities in a 2x2x2 cube.

      Negative values are allowed and work correctly in the negative directions; however the selection area is still extended 1 in all positive directions.
      For example, If you have an armor stand besides you at each side, aligned to the x axis,
      @e[dx=-1] would select you and both armor stands, rather than just the one on the negative side.

      This is an edited copy of the Java Edition equivalent MC-123441, and relates to MCPE-171423.

      Steps to reproduce

      Setup some armor stands

      1. Run the following commands:
        /execute align xyz run summon armor_stand ~0.5 ~ ~0.5 ~ ~ a Center
        /execute at @e[type=armor_stand,name=Center] run summon armor_stand ~1 ~ ~1 ~ ~ a Positive
        /execute at @e[type=armor_stand,name=Center] run summon armor_stand ~-1 ~ ~-1 ~ ~ a Negative
      2. Run the following command:
        /execute at @e[type=armor_stand,name=Center] run say @e[dx=0,dy=0,dz=0,type=armor_stand]

        →  It finds "Positive" even though an area with the size of 0x0x0 is provided.

      3. Use the following command:
        /execute at @e[type=armor_stand,name=Center] run say @e[dx=-1,dy=-1,dz=-1,type=armor_stand]

        →  It finds all armor stand even though it should not find "Positive" as a negative area is provided.

            zTxrbq [Mod] turbo
            Votes:
            6 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: