Mojira Archive
MCPE-174949

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

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.

Unresolved

[Mod] turbo

user-f2760

2023-09-12, 05:23 PM

2024-07-06, 02:05 AM

7

3

Confirmed

1124689

1.20.40.20 Preview - 1.21.1 Hotfix1.20.40.20 Preview, 1.20.15 Hotfix, 1.20.50.22 Preview, 1.20.50.21 Preview, 1.20.40, 1.20.73 Hotfix, 1.21.1 Hotfix

-