mojira.dev
MC-132170

Negative dx/dz values are inaccurate.

When using negative dx & dz values as an entity specifier, the "detection square" has a weird offset from where you execute it;

 

When using dx=10, dz=10 it will detect you with in a square which is 10x10. (Like it should)

https://imgur.com/wcWWZp4.png

 

When using dx=-10, dz=-10 it will still detect you within the square, but the size of the square becomes 12x12, and the square will have an offset from the entity you execute it from

https://imgur.com/FVf7gYL.png 

 

Here is a small video showing the bug in action;

https://youtu.be/UecqpJ1wH-0

 

(Command used in gif:

/execute as @e[type=armor_stand] at @e[type=armor_stand] run say hi @a[dx=10,dz=10]

/execute as @e[type=armor_stand] at @e[type=armor_stand] run say hi @a[dx=-10,dz=-10]

)
 

 

Attachments

Comments 5

Please do not mark unreleased versions as affected.
You don't have access to them yet.

Please check that you don't run into the "negative coordinates fallacy", see e.g. MC-36602 or MC-4794

Maybe it's helping to shift the center of the selector by 0.5 blocks

@a[x=~0.5,z=~0.5,dx=10,dz=10]

(Disclaimer: didn't test it...)

I don't know for the most recent snapshot, but are not the dx, dy and dz supposed to be positive ?

^ Tried it, didn't work for me. 12x12 square still a thing

It's not related to negative coordinates, the selection box is literally 1 block bigger on the positive sides, I can stand 1 block outside of the range on the positive side with positive values too and it still detects me.

However, aligning the executed location to the block grid (execute align xyz) makes it behave correctly.
The issue you experience is caused by the armor stand position being X.5 Y Z.5 rather than X.0 Y Z.0; yes, it worked before in 1.12, no that's not a bug; in 1.13 the dx/y/z selector arguments no longer make it snap to the grind by design.

SwatDoge

(Unassigned)

Unconfirmed

Minecraft 1.13-pre4

Retrieved