mojira.dev
MC-109837

Debug menu interprets -0 coordinate while commands don't

I know that this is technically a duplicate of MC-36602, but this is how it should be fixed.

Make a new Redstone Ready superflat world, and run this command:

/tp @p 0 56 0

After that, run this command:

/setblock 0 55 0 minecraft:red_sandstone

A red sandstone block will be placed under you. After that, go into the debug menu (F3) and take a step west. Your X coordinate should be `-0`. Run this command to mark this position.

/setblock ~ 55 ~ minecraft:red_nether_brick

Now, run this teleportation command. This changes the coordinates to the same ones you are standing on now.

/tp @p -0 56 0

Notice anything? It will teleport you back onto the red sandstone, and not keep you on the red nether brick. This is because the debug menu interprets `-0` as a different coordinate than `0`. The debug menu's `-0` are commands' `-1`. In order to fix this, the debug menu has to get rid of `-0` (it isn't a real number). We don't need any savefile changes; you just need to offset the coordinates by -1 if the coordinates are less than 0.

Linked issues

Comments 7

Cannot confirm for 1.11

Do you mean -0.x? as x coordinate?

Please answer otherwise will be closed as Incomplete!

Yes, as in -0 for any coordinate (X, Y, or Z).

@unknown, there's a "Block" on the debug screen, which shows the exact coordinates. And there's no -0 there, only -1 and 0.
So, this is WAI and a dupe of MC-36602

The xyz of where you stand shows -0.

-0.00000000001 != -0

@Purpur The debug menu only reads the nearest 3 digits for X and Z coordinates. So -0.0001 would be -0.000 according to the debug menu. Commands calculate this fully so would give a response of "Teleported ? to -1.0E-4, 62.0, -1.0E-4" as 0 cannot be - or +

Purpur

(Unassigned)

Unconfirmed

Minecraft 1.11 Pre-Release 1

Retrieved