mojira.dev
MC-111144

/stats does not find marker armorstands in upper half of a block

The second selector of the /stats entity command does not find marker armorstands that are in the upper half of a block when using r=0 or dy=?.

Steps to reproduce:

  1. /scoreboard objectives add STATS_TEST dummy
  2. /scoreboard objectives setdisplay sidebar STATS_TEST
  3. /summon armor_stand ~ 57.6 ~ {Tags:["statsTest"],NoGravity:1,Marker:1}
  4. /scoreboard players set @e[type=armor_stand,tag=statsTest] STATS_TEST 0
  5. /stats entity @e[type=armor_stand,tag=statsTest] set SuccessCount @e[type=armor_stand,tag=statsTest,r=0,c=1] STATS_TEST
  6. /execute @e[type=armor_stand,tag=statsTest] ~ ~ ~ testfor @p

After the execute-testfor command the armorstand should have a score of 1, but it has a score of 0. If I repeat the same experiment with other y values and other selectors instead of

r=0

there are the results:

r=0

r=1

dy=0

dy=1

57.0

57.1

57.4

57.5

57.6

57.9

A useful command to get rid of all the Armorstands

/kill @e[type=armor_stand,tag=statsTest]

Here is a OneCommand that creates the setup

summon falling_block ~ ~1 ~ {Block:redstone_block,Time:1,Passengers:[{id:falling_block,Block:activator_rail,Time:1},{id:commandblock_minecart,Command:fill ~1 ~-2 ~1 ~4 ~-1 ~2 air},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~2 command_block 5  {Command:scoreboard objectives add STATS_TEST dummy}},{id:commandblock_minecart,Command:setblock ~3 ~-2 ~2 chain_command_block 5  {auto:1,Command:scoreboard objectives setdisplay sidebar STATS_TEST}},{id:commandblock_minecart,Command:setblock ~4 ~-2 ~2 chain_command_block 1  {auto:1,Command:summon armor_stand ~ 57.6 ~ {Tags:["statsTest"],NoGravity:1,Marker:1}}},{id:commandblock_minecart,Command:setblock ~4 ~-1 ~2 chain_command_block 4  {auto:1,Command:scoreboard players set @e[type=armor_stand,tag=statsTest] STATS_TEST 0}},{id:commandblock_minecart,Command:setblock ~3 ~-1 ~2 chain_command_block 4  {auto:1,Command:stats entity @e[type=armor_stand,tag=statsTest] set SuccessCount @e[type=armor_stand,tag=statsTest,r=0,c=1] STATS_TEST}},{id:commandblock_minecart,Command:setblock ~2 ~-1 ~2 chain_command_block 4  {auto:1,Command:execute @e[type=armor_stand,tag=statsTest] ~ ~ ~ testfor @p}},{id:commandblock_minecart,Command:setblock ~ ~-2 ~ command_block},{id:commandblock_minecart,Command:setblock ~ ~2 ~ command_block 0  {Command:fill ~ ~-3 ~ ~ ~ ~ air}},{id:commandblock_minecart,Command:setblock ~ ~1 ~ redstone_block},{id:commandblock_minecart,Command:kill @e[type=commandblock_minecart,r=0]}]}

Linked issues

Comments 4

Skylinerw

This would be MC-88533.

As a work-around, removing the Marker tag should help, but of course you may need it for what you're doing. You could otherwise use a different entity for marking position, such as an area_effect_cloud with a high Duration.

Adrodoc55

@skylinerw this affects dy too, are you sure it is related? and wasn't MC-88533 caused by a y coordinate without decimal places?

Skylinerw

dy is also affected in the other report, I'll update the title. While the issue described here is the essentially same in the other, there seems to be an offset specific to CommandStats.

A quick look at the source doesn't show me anything obvious right away though. I'll reopen this report as it may be unlikely this one will get fixed if the other one does.

tryashtar

No longer relevant since /stats is gone in 1.13. If you can still obtain this behavior through some other command, just speak up 🙂

Adrodoc55

(Unassigned)

Confirmed

Minecraft 1.11, Minecraft 1.11.2

Retrieved