So recently, I have been playing on a server in 1.13. I made an area that I plan to put an iron farm and a mob farm in the center. When I made my walls (the fences), I used my X cords coordinates to measure how long one fence wall needed to be. When measuring from end to end with coordinates, the wall measured to be 50 blocks long as seen from the 1st and 2nd image. However, when measuring manually, the wall turns out to be 51 blocks long as seen from the 3rd image. What is troubling me is that these two methods of measuring things that should work, completely contradict each other.
Could someone shed some light on this situation? (No, I do not need the center point calculated.)
69 minus 19 = 50 but 19 to 69 is 51 since you're counting both ends.
Suppose you wanted a fence that was 1 block long, it would only take up 1 block so both "ends" would be on the same block, lets say X=0, 0 minus 0 = 0 so that doesn't work, you need to add one to get the length.
The X / Z coordinates are for one corner of the block, NW I think
Say your fence goes from left to right and the coordinates point to the left edge of a block, the coordinates of the block the left end of the fence is standing on will point to the end of the fence but the coordinates of the block at the right end will point to the left edge of that block even though the fence continues to the right edge so you will be missing a block by just subtracting the coordinates.
So recently, I have been playing on a server in 1.13. I made an area that I plan to put an iron farm and a mob farm in the center. When I made my walls (the fences), I used my X cords coordinates to measure how long one fence wall needed to be. When measuring from end to end with coordinates, the wall measured to be 50 blocks long as seen from the 1st and 2nd image. However, when measuring manually, the wall turns out to be 51 blocks long as seen from the 3rd image. What is troubling me is that these two methods of measuring things that should work, completely contradict each other.
Could someone shed some light on this situation? (No, I do not need the center point calculated.)
69 minus 19 = 50 but 19 to 69 is 51 since you're counting both ends.
Suppose you wanted a fence that was 1 block long, it would only take up 1 block so both "ends" would be on the same block, lets say X=0, 0 minus 0 = 0 so that doesn't work, you need to add one to get the length.
The X / Z coordinates are for one corner of the block, NW I think
Say your fence goes from left to right and the coordinates point to the left edge of a block, the coordinates of the block the left end of the fence is standing on will point to the end of the fence but the coordinates of the block at the right end will point to the left edge of that block even though the fence continues to the right edge so you will be missing a block by just subtracting the coordinates.
That math does not add up. What I am trying to say is that when I count the blocks that the fence are adjacent with I get 51, but when I use the coordinates to count, I get 50.
Like I just said, I am not talking about fences. I am talking about how long they are. This has nothing to do with fences. Its the math that I get when counting the blocks. I counted the blocks adjacent to the fences, and it gives me 51, but when I use the coordinates to count, I get 50.
I presume you are counting the corner blocks even though they don't have fences on them since you have a torch next to at least one?
How are you using the coordinates? (Since 4869 - 4819 = 50 I'm presuming that's what you're doing?)
Look at my example below and tell me if you can see what's wrong with it.
Then tell me how it differs from yours.
(Seriously, I'm not trying to poke fun at you or anything, I just think this is what you are doing wrong. BTW, the fence post error isn't specifically about fences either, that's just one example.)
If I count the torches next to my square I get 1 but if I use the coordinates to count I get 0
(If I use the coordinates the way you seem to be doing it, used correctly (X2-X1+1) you get 1)
69 minus 19 = 50 but 19 to 69 is 51 since you're counting both ends.
Suppose you wanted a fence that was 1 block long, it would only take up 1 block so both "ends" would be on the same block, lets say X=0, 0 minus 0 = 0 so that doesn't work, you need to add one to get the length.
The X / Z coordinates are for one corner of the block, NW I think
Say your fence goes from left to right and the coordinates point to the left edge of a block, the coordinates of the block the left end of the fence is standing on will point to the end of the fence but the coordinates of the block at the right end will point to the left edge of that block even though the fence continues to the right edge so you will be missing a block by just subtracting the coordinates.
...I actually see what you mean now... My friend had to show me what you meant. This whole thing really is just a big mind bender. Thanks all who helped me out!
So recently, I have been playing on a server in 1.13. I made an area that I plan to put an iron farm and a mob farm in the center. When I made my walls (the fences), I used my X cords coordinates to measure how long one fence wall needed to be. When measuring from end to end with coordinates, the wall measured to be 50 blocks long as seen from the 1st and 2nd image. However, when measuring manually, the wall turns out to be 51 blocks long as seen from the 3rd image. What is troubling me is that these two methods of measuring things that should work, completely contradict each other.
Could someone shed some light on this situation? (No, I do not need the center point calculated.)
______________________________________________||___________________________________________________________________________________________________________________________________________________69 minus 19 = 50 but 19 to 69 is 51 since you're counting both ends.
Suppose you wanted a fence that was 1 block long, it would only take up 1 block so both "ends" would be on the same block, lets say X=0, 0 minus 0 = 0 so that doesn't work, you need to add one to get the length.
The X / Z coordinates are for one corner of the block, NW I think
Say your fence goes from left to right and the coordinates point to the left edge of a block, the coordinates of the block the left end of the fence is standing on will point to the end of the fence but the coordinates of the block at the right end will point to the left edge of that block even though the fence continues to the right edge so you will be missing a block by just subtracting the coordinates.
Just testing.
This particular error is so common it even has names; one of which is a "Fence Post error" see https://en.wikipedia.org/wiki/Off-by-one_error#Fencepost_error
That math does not add up. What I am trying to say is that when I count the blocks that the fence are adjacent with I get 51, but when I use the coordinates to count, I get 50.
Like I just said, I am not talking about fences. I am talking about how long they are. This has nothing to do with fences. Its the math that I get when counting the blocks. I counted the blocks adjacent to the fences, and it gives me 51, but when I use the coordinates to count, I get 50.
______________________________________________||___________________________________________________________________________________________________________________________________________________I presume you are counting the corner blocks even though they don't have fences on them since you have a torch next to at least one?
How are you using the coordinates? (Since 4869 - 4819 = 50 I'm presuming that's what you're doing?)
Look at my example below and tell me if you can see what's wrong with it.
Then tell me how it differs from yours.
(Seriously, I'm not trying to poke fun at you or anything, I just think this is what you are doing wrong. BTW, the fence post error isn't specifically about fences either, that's just one example.)
If I count the torches next to my square I get 1 but if I use the coordinates to count I get 0
(If I use the coordinates the way you seem to be doing it, used correctly (X2-X1+1) you get 1)
Just testing.
...I actually see what you mean now... My friend had to show me what you meant. This whole thing really is just a big mind bender. Thanks all who helped me out!
______________________________________________||___________________________________________________________________________________________________________________________________________________