4

I have this command below in a command block, but it doesn't work.

execute @p ~ ~ ~ tp @e[type=ArmorStand] ~ ~-8 ~

It should teleport the armor stand 8 blocks below the player, but it doesn't. It teleports the armor stand relative to the armor stand. Do you have an answer for this?

Thanks in advance.

2

The current answers are all outdated. Now there's the /teleport (archive) command, which has none of the side effects of the current answers:

/teleport @e[type=armor_stand] ~ ~-8 ~

/teleport teleports relative to the executor instead of relative to the target, which makes it consistent which other commands.

In 1.13+ you can also write tp instead of teleport, because it behaves the same.

0

You would need to make a setblock/fill clock and then write these commands in order:

execute @e[type=Player] tp @e[type=ArmorStand] @p
tp @e[type=ArmorStand] ~ ~-8 ~

Then the Armor Stand will be teleported to you and then it will be teleported eight Blocks Down.

0

For version 1.9, you would have a repeating command block with the command /tp @e[type=ArmorStand] @p, and a chain command block set to conditional with the command /tp @p ~ ~-8 ~.

0

/execute as @e[type=armor_stand] run tp yourname @s

/execute as executes as the selected entity. For example, if you ran /execute as your friend ran kill @s, it'd kill your friend.

tp @s just teleports yourself to the entity it's being ran from.

-1

Nevermind, I believe I found a fix.

As shown here, two separate teleports should be used - the first to teleport the armor stand to the object, and the second to teleport the armor stand relative to their new position.

So execute @p ~ ~ ~ tp @e[type=ArmorStand] ~ ~-8 ~ becomes

/tp @e[type=ArmorStand] @p
/tp @p ~ ~-8 ~
4
  • 1
    Welcome to Arqade. Please take a look at the tour and help center. While self-answering is perfectly valid (it helps other people, after all), link-only answers are bad. There is no guarantee the link will work in a year or two, and SE sites are built to last. Could you please edit you answer to include a summary of the solution in the link?
    – MrLemon
    Jul 7 '15 at 9:14
  • What if there's more than one armor stand in the world? I'm not sure what would happen (you can't teleport to more than one location at once). If it does cause an error, it could be fixed by adding the coordinates of the armor stand: @e[type=ArmorStand,x=x,y=y,z=z]
    – Nick B.
    Jul 8 '15 at 2:23
  • Ok, I will take note of that next time. Thank you. Jul 9 '15 at 11:32
  • @NickB. You can give each armor stand a name. Also, I believe my method was just a tad bit method. I will edit my own answer. Jul 9 '15 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.