0

Basically I have a command block on repeat without need of redstone and the command is:

execute if entity @p[dy=1] run tp @p ~7 80 ~-20

The purpose of it is to attempt seamless teleport which has worked... well sort of. When i walk over it, it teleports me to the correct coordinates but always finishing at 0.5. What I mean is this, if my x coordinate is 123.2152 then if i teleport relatively to -2 blocks then it ends up at 121.5 not 121.2152.

How do I get it to end up at not 0.5? Thanks.

0

You just have to add .0 to turn it into an exact number:

/tp @s 100.0 100.0 100.0

teleports you exactly to 100.0 100.0 100.0 without centering you in the block.

Btw, this is not a behaviour of the relative teleport, so it wouldn't change anything in your example command. I assume your example command is in a command block, in that case it teleports you relative to the command block bottom center, so you would have to subtract 0.5 from the x and z coordinate to end up on a block corner.

  • I'm not trying to end up at the corner of a block and yes it is in a command block. I've tried using @s and it still teleports to half block precision. – Chez Block Nov 5 '18 at 9:03
  • As I said, it's not @s that does it, that just selects yourself. It's .0. – Fabian Röling Nov 5 '18 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.