Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Created May 18, 2019 22:54
Show Gist options
  • Save sinewalker/fea5f20367ede2da1d7d2ae982e4a091 to your computer and use it in GitHub Desktop.
Save sinewalker/fea5f20367ede2da1d7d2ae982e4a091 to your computer and use it in GitHub Desktop.
Minecraft Pi Edition Python Coords vs Minecraft Debugging Coords

To fix your Minecraft world so that the coordinates displayed on the F3 debugging screen match what the MCPI API tells you with player.getPos() or player.getTilePos(), issue this Command in the game (requires Multiplayer, or a World generated with Cheat Codes enabled):

/setworldspawn 0 0 0

(to do this, press T or / and then type /setw followed by the TAB key, and then 0 0 0. For some reason you can't type this command out in full on the Talk window.)


An explanation is given in the discusson on the Stuff about code MCAPI reference. Breifly, the coordinates that the MCPI API returns with player.getPos() or player.getTilePos() are relative to the Minecraft World Spawn Point.

This is why they don't match what you see if you press the F3 key in the Minecraft game: those are the absolute coordinates in the world. The World Spawn Point is different to the Player Spawn Point also, so resetting the player's spawn (with a /setspawn command, or by building a bed and sleeping) will not change the coordinates returned by the the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment