TransWikia.com

Teleporting behind player

Arqade Asked by NotSaz on May 22, 2021

How is it possible to teleport an armour stand behind a player (with its position updating as the player moves) in 1.15+?

One Answer

You'll need to create a scoreboard tag for each player and armor stand pair to use this command.

/execute as @e[tag=stand1,type=minecraft:armor_stand] positioned as @a[tag=stand1] run teleport @s ~ ~1 ^-1 facing ^ ^ ^

This command should teleport an armor stand to the nearest player, one block above and one behind them.

Breakdown of command:
/execute as @e[tag=stand1,type=minecraft:armor_stand] - This will pick an armor stand with the scoreboard tag "stand1" and execute the command from it.
positioned as @p[tag=stand1] - Sets all the relative positions used with ~ and ^ to be relative to the player with the scoreboard tag "stand1".
run teleport @s ~ ~1 ^-1 - Teleports the armor stand to the player, up one block, and one block behind the direction the player is facing.
facing ^ ^ ^ - Causes the armor stand to face the same direction the player's head is.

Answered by Corsaka on May 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP