#Teleport entoty to its x and z, but player's y

1 messages · Page 1 of 1 (latest)

grizzled meteor
#

I want to teleport an entity to the players y, but keep the entiries x and z pos, i thought of using macros, but don't really know how to make it.

brisk grottoBOT
#
**Someone will come and help soon!**

💬 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

bold carbon
#

execute as @e[tag=yourentity] at @p run teleport ~0 ~ ~0 idk ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

grizzled meteor
#

So it only changes the y axis based on players, but stays in place

bold carbon
#

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

raw socket
#

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

grizzled meteor
#

thanks @bold carbon

brisk grottoBOT
grizzled meteor
#

thanks @raw socket

brisk grottoBOT