Coordinate Rounding Bug

Started by Tence Sailor on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 18:23, 11. Apr 2020
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Coordinate Rounding Bug

The coordinate system for MCreator is a little weird. If I build a procedure to set blocks relative to a player's position, it almost never works. Even with the simplest procedure, such as Place Block At X Y Z. This only works correctly if the X coordinate is positive and the Z coordinate is positive. Each coordinate is rounded towards 0 for whatever reason. If I want to place a block at -10 ~ 10, and my coordinates are -9.876 ~ 10.987 respectively, MCreator rounds the player coordinates to -9 ~ 10, which isn't the player's position. It's the block next to the player. If the X and Z coordinates are both negative everything is shifted diagonally towards 0 ~ 0. In addition, if I want to teleport a player by one block, the coordinates are not preserved. Someone standing at X = 1.5 being teleported to X + 1 will not appear on X = 2.5, but 2. This is extremely annoying, and should be an easy fix. Please work on this as soon as possible. 

This is how Java works, it…
Sun, 06/16/2019 - 16:58

This is how Java works, it just trims decimal part by default. You can use a round block from math procedure blocks to do proper rounding.