#Teleport entoty to its x and z, but player's y
1 messages · Page 1 of 1 (latest)
💬 While you wait, take this time to provide more context and details. What are you trying to achieve overall - maybe there's an easier way to solve this problem
🙇 If it's been 30 minutes and you're still waiting for someone to help, hit the Summon Helpers button to call the official helpers here
✅ Once your question has been resolved (or you no longer need it), hit the Resolve Question button or run /resolve
execute as @e[tag=yourentity] at @p run teleport ~0 ~ ~0 idk ¯\_(ツ)_/¯
No i meant like, i want to teleport the entity to the players y pos, but to keep the entities x and z pos
So it only changes the y axis based on players, but stays in place
I know what you meant
I just thought it's easy but i was proven otherwise
execute store result score @s y_backup run data get entity @s Pos[1]
data modify entity @e[your selector] Pos[1] set from score @s y_backup
You can change the @s and @e[your selector] selectors
@grizzled meteor
Your role says advanced datapacker and im a newbie datapacker
you can do that in a single command with more precision by doing
data modify entity <ENTITY> Pos[1] set from entity <PLAYER> Pos[1]
but that can be expensive, i'm sure there is a smart way using execute and tp only but I can't think of it rn
Yeah this is better
that didnt quite work for me, ig i did it wrong but thank you
thanks @bold carbon
We're happy that @bold carbon helped you with your question!
If your question is now done, please don't forget to close the question with /resolve.
thanks @raw socket
We're happy that @raw socket helped you with your question!
If your question is now done, please don't forget to close the question with /resolve.