So I was playing with command blocks using the range argument. Specifically I was trying to replace pressure plates with command blocks using the "testfor" command. I had 2 ways to do it, A) specified range but no specified xyz which makes it use the command block's location as the center of the range, and B) specifying a range and an xyz to start from.
The problem is when it's from the command block the lowest range (1) counts as "you'd have to be standing in the command block" but when it's from a specified xyz it's "that spot plus 1 block out".
My immediate thought was "Mojang obviously tried to bugfix the first problem but applied the fix to the wrong spot". Am I right or is that clearly the only way to interprete this reversed situation? (no disrespect intended. Those Mojang folks have given me more hours of enjoyment than any other game company in the past DECADE!)
Oh steps to reproduce? Start a single player game on creative with cheats, use "/give @p 137" to get a command block. Set it down and program "/testfor @p[r=2]" into it. Hook up a hopper clock to it (2 hoppers that point to each other with a tool in it that they pass back and forth), use a comparitor to connect one of the hoppers to the command block, use another comparitor to hook the output to a piston pointed up (just for an easy to see end result). Step on blocks next to the command block to get a reaction out of the piston. It should be clear that in this situation (no xyz specified) range 2 counts as the command block itself + 1 block away. Now try it with a range of 1. It won't work because you'd have to be standing IN the command block.
NEXT try the same experiment with xyz coordinates. Even with the range set to 1 it will activate for the specified block PLUS ANY BLOCK BESIDE IT (not counting diagonal because that counts as "1 block forward + 1 to the right = 2 blocks away" like with the lighting)
Technically of course I can still achieve my original goal of using it to replace pressure plates by moving the xyz point down 1, although I have to make sure no walking areas go through the bottom 2 levels of the globe.
EDIT: So I just tested it again and got different results (range 1 with no xyz got the same result as with xyz), which doesn't change the second one being wrong but still how did I manage that?
Linked issues
Comments 9
This is working as designed, the issue you are experiencing in negative coordinates is as intended. Systems use 0 as a number, and placing blocks adds 0.5 to the coordinates to center the block on the coordinates.
@Th3 The issue you are experiencing is a calculation error in MC which begins about 30,000 (barely noticeable) and becomes obvious at 1mil. See MC-3718 for related.
uh...not sure how that answer (the one to me not the one to Th3 of course) relates to my issue at all. Who said anything about negative coordinates? The main glitch is that you can't specify an xyz and have it apply to just that spot. A 3x3x3 globe is the smallest it allows (well a plus with a block above and below the center).
Please unlink the "duplicate of" link. That has nothing at all to do with this bug. I think a moderator forgot which thing he was replying to.
EDIT: thinking about it I'm pretty sure the moderator just read the title and not the description. Which means he'll never read any of this. I've re-submitted this as a fresh bug report with clearer title and much more consice message.
Found a solution. You just have to cause an integer overflow. Yes this is what pretending bugs aren't bugs leads to. Saw it on a SethBling youtube video so it's not obscure either.
This has been fixed. r=0 now means a single block. See MC-44785.
Any chance a mod could change the incorrect resolution. It was never a duplicate. It was a bug and it was resolved in 14w03. I know it's petty of me to want my fixed bug reports to actually list as fixed rather than an incorrect marking of duplicate or invalid from a mod not bothering to read past the title and mismarking it but there you go.
Not sure if its related but we have found with certain redstone devices, location in the world of the actual blocks and items withing the redstone circuit actually affect the outcome (i,e, the same set up 4 blocks east may produce a different out come than the original)