#Teleport where the player is looking

1 messages · Page 1 of 1 (latest)

high fox
#

Is there any way to make a player tp wherever they are looking like with ^^^ in the /tp command? For example 8 blocks in front of them (^^^8)

sonic canyon
#

Everything is just MATH bro

#

how well you know vectors?

high fox
#

i cba to actually do math lmao

sonic canyon
#

the math is easier way xd

high fox
#

jkrgshjk

#

pain

sonic canyon
#

ok

#

so

#

view Direction is normalized vector

#

so its 1

#

1 block forward from player in looking direction

#

so if you multiply each axis by 8

#

it will be 8 blocks from player in that direction

#

then add that Vector to players location

#

thats all

high fox
#

oh

#

alright thanks

sonic canyon
#

np

#

👍

#

also you dont have to use BDS tag to this question

high fox
#

ye ik

olive olive
#

Would you be able to just use “getBlockFromViewDirection()” and teleport to that block?