1

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?

1 Answer 1

1

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.

2
  • 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
    Commented Nov 5, 2018 at 9:03
  • As I said, it's not @s that does it, that just selects yourself. It's .0. Commented Nov 5, 2018 at 9:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .