Selector distance argument is position based while dx,dy,dz are hitbox based
The bug
It appears the following selector arguments do not behave consistently:
- distance: Finds entities whose position (center of the hitbox) is within the area
- dx, dy, dz: Finds entities whose hitbox intersects with the area
This might be intended, but can also have unexpected side-effects and be unintuitive.
How to reproduce
- Place a block at (0,0) in the floor so you know where it is
- Show hitboxes (F3 + B)
- Move around (0,0) and run the following command
/say @s[x=0.5,z=0.5,distance=..0.5]
It finds you as soon as the center of your hitbox is inside a circular area with center at (0.5,0.5) with radius 0.5
- Move around (0,0) and run the following command
/say @s[x=0.0,z=0.0,dx=0,dz=0]
It finds you as soon as your hitbox intersects with the block area of (0,0)
2020-02-13, 09:31 PM
2023-11-06, 10:02 PM
2020-02-26, 10:19 AM
5
6
-