![]() ![]() ![]() The position of the block 1 block East of the player is (~1, ~0, ~0).The position of the player’s head is 1 block above their feet, its relative position is (~0, ~1, ~0).Here are more examples of relative positions: You can create a relative position using the ||positions:~0 ~0 ~0|| block. Keep this in mind when using relative positions in your code! If the player moves, then (~0, ~2, ~0) is no longer at the same block as before the player moved. Players are two-block tall, so it is important to note that the position (~0, ~0, ~0) corresponds to the player’s feet.īecause relative positions start from where the player’s feet are, relative positions aren’t fixed in the world - they “move” with the player.įor example, the relative position (~0, ~2, ~0) will always correspond to the block that is currently above the player’s head, no matter where the player is in the world. Relative positionsĪ relative position has ~ before each number and is centered on the player’s current position: (~0, ~0, ~0). There are two kinds of positions: a relative position and a world position. Need to know where East, West, South, North are pointing to? Try the compass to visualize cardinal directions. Need to visualize x, y, z? Try the 3D Axis example to see the x, y, z axes.
0 Comments
Leave a Reply. |