mojira.dev
MC-97316

Target selector arguments r, rm are counting distance from middle of bottom face of block instead of position of entity running a command

Executed command from command block minecart, as player and via /execute with target selector arguments r/rm are counting distance from middle of block instead of position of entity. This is the case of unexpected behaviour of selector r=X.
Example:
Run a command in command block minecart: /kill @e[r=0] when minecart is in center of block. Minecart will vanish as intended.
Run the same command, when minecart is in the edge of block. Minecart will not disappear.
This is inconsistent and should be fixed.

in 1.9 pre 3 r=0 can't kill anything, even an executer and entities in the same position.

Linked issues

Attachments

Comments 34

stop.x

Not exactly. I have tried to stand at coordinate (1.536,21.00000,0.736) and run command

/kill @e[r=0]

and I was killed.

Irbis

r=0 is killing all within 0.25 block from center of block.

Meri Diana

It means if I try to kill an entity, e.g. an ArmorStand or myself, with

kill @e[r=0]

, it doesn't succeed (which it should imo, it'd make many things easier).

Execution at the entity's postion.

The way r=0 and r=1 look like in the latest snapshot is not ideal imo, the shape r=1 got can cause interference in some cases (it would in some of my aesthetical machines/generators).
Ideally (from my perspective, please correct me if you think differently, I'm by far not the most experienced CBer), r should equal the actual radius (not making a weird shape), but instead of using a block's postiion using the position of the entity.

That would result in r=0 targetting only entities at the exact coords, if I understand that correctly, so that r=0 would be useful.
Setting it to a radius of 0.25 is not a good solution imo, but understandable from how the current system is set up.

Can there be any performance issues by executing at the entity's postion, is it doable at all?

Uploading a graphics made by @unknown showing the current r=0 and r=1 shape.

stop.x

The point is that it worked fine in all previous snapshots. Now because of this floor crafting (command block creation) is totally broken.

Meri Diana

Also: Related to MC-96927
96927 rather for discussion about selector "c" and here for "r", to differentiate between both?
96927 is the older post and mentions both r as well as c, so if one bugpost should cover both selectors, then probably select 96927 by @unknown.

24 more comments
stop.x

Is r=0 really testing "radius = 0" rather than "radius = 0.25"?

/summon ArmorStand ~ ~ ~0.01

and

/execute @e[type=ArmorStand] ~ ~ ~ kill @e[type=Player,r=0]

will not kill the player.

Skylinerw

@@unknown It was changed again in pre-4. It's now exact coordinates once again.

stop.x

@Skylinerw So (r=0) is no longer 0.25 block from the executing point?(used to be 0.25 block in 1.8 and snapshots before 16w06a)

Skylinerw

@@unknown It was not 0.25 in 1.8, instead it was buggy and inconsistent (which is now fixed via MC-95352). Starting with one of the previous snapshots, r=0 was truly 0. In the next snapshot, it was 0.25. After that, it was 0.015625. Now it's back to 0.

stop.x

@Skylinerw Got it, Thanks!

Irbis

(Unassigned)

Community Consensus

Minecraft 16w07b, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3

Minecraft 1.9 Pre-Release 4

Retrieved