Advertisement
Rsdg

Coordinates/PointDistance Calculation in Minecraft

Dec 11th, 2015
969
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Activate these once, in this order:
  2.  
  3. scoreboard objectives add Coordinate dummy
  4. scoreboard objectives add X dummy
  5. scoreboard objectives add Z dummy
  6. stats entity @a set AffectedBlocks @p Coordinate
  7. scoreboard players set @a Coordinate 0
  8.  
  9.  
  10.  
  11. Put the following on a Clock, in this order:
  12.  
  13. execute @a ~ ~ ~ fill ~ 0 ~ ~ 0 1 stone 0
  14. execute @a ~ ~ ~ fill ~ 0 ~ ~ 0 1 bedrock 0
  15. execute @a ~ ~ ~ scoreboard players operation @p Z = @p Coordinate
  16. execute @p ~ ~ ~ fill ~ 0 ~ 1 0 ~ stone 0
  17. execute @p ~ ~ ~ fill ~ 0 ~ 1 0 ~ bedrock 0
  18. execute @a ~ ~ ~ scoreboard players operation @p X = @p Coordinate
  19.  
  20.  
  21.  
  22.  
  23. If you want to have a display objective for the coordinates, add these commands:
  24.  
  25. Once: scoreboard objectives add Coords dummy
  26. Clock:
  27. scoreboard players operation X Coords = @p X
  28. scoreboard players operation Z Coords = @p Z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement