Mojira Archive
MCPE-32094

Selectors erroneously find all entities in overlapping blocks

The bug

Selector arguments such as c, r, dx, dy, and dz work entirely on the block level – an entity that is physically outside the range will still be detected if it anywhere is inside a block that is partially inside the range.

How to reproduce

1. Teleport yourself to the center of some block: /tp @s 0 64 0
2. Summon an armor stand 1.5 blocks away from you: /summon armor_stand ~ ~ ~1.5
3. Run a selector from the armor stand: /execute @e[type=armor_stand,c=1] ~ ~ ~ say @a[r=1]
Expected result: empty output since the player is further than one block away.
Actual result: player is found.

The player can continue moving even further away from the armor stand – any position in the block teleported to will be found by the selector, even those that should not be. Even if the armor stand is in a position such that the r=1 "sphere" barely overlaps a block, entities will be found regardless of where they are in that block.

In practice, this makes precise position selectors difficult or impossible – despite the existence of decimal selector arguments, all searches are done on a per-block level. I used integers exclusively to demonstrate here, but this is easily reproducible with the decimal ones: /execute @e[type=armor_stand,c=1] ~ ~ ~ say @a[r=0.001] should almost never find players, but in reality it finds every player that shares a block with it.

Fixed

[Mod] tryashtar

2018-04-05, 03:15 AM

2018-07-21, 11:07 AM

2018-04-26, 12:53 AM

1

0

Unconfirmed

1.2.14.3, 1.2.13.54

1.5.0.14