Mojira Archive
MC-124771

AffectedBlocks/testforblocks will often return a 1or a 0 when counting blocks in the negative x or z axis

Illustrative example:

Objectives previously added include xPos and is set to 0 to initiate its scoreboard tracking.

In a mcfunction, running the following lines every tick in a mcfunction via gamerule gameLoopFunction

execute @a ~ ~ ~ stats entity @a set AffectedBlocks @s xPos
execute @a ~ ~ ~ testforblocks ~ ~ ~ 0 ~ ~ 0 ~ ~
execute @a ~ ~ ~ title @s actionbar ["",

{"text":"x= ","color":"dark_green"}

,{"score":

{"name":"@a","objective":"xPos"}

,"color":"dark_green"}]

So long as the player is in the positive x-axis half of the world, AffectedBlocks testforblocks consistently and reliably returns a proper x-axis block count.

When the player stands in the negative x half of the world, AffectedBlocks testforblocks intermittently correctly counts the blocks in the x coordinates, and intermittently incorrectly returns a 1 or a 0.

The same is true for z coordinates. It is not relevant for y as there are no negative y coordinates to contend with in play.

See attached screen shot illustration of this occurring.

Invalid

Scott Miller

2018-02-03, 09:00 PM

2018-02-06, 04:27 AM

2018-02-03, 09:13 PM

0

0

Unconfirmed

Minecraft 1.12.2

-