I'm trying to make an armour stand move one block to the side using a command, but that command just teleports it to the command block /tp @e{type=Armour_Stand,name=Player} ~ ~ ~-1 Is there a way to make it just move one block sideways?


You have to start by fixing your command, the target selector uses [ ] and NOT { }, and the armor stand is internally called armor_stand, or minecraft:armor_stand to be more precise, and NOT Armour_Stand:

/tp @e[type=minecraft:armor_stand,name=Player] ~ ~ ~-1

Now, as you already said, the armor stand teleports relative to the command block, this happens, because the command is executed as the command block, to fix this you would tell the command to execute as the armor stands instead:

/execute as @e[type=minecraft:armor_stand,name=Player] run tp ~ ~ ~-1

Now you run this command and... it still fails.

This happens, because the command now executes AS the armor stands, but still at the coordinates of the command block. To fix this you would also need to execute at the coordinatees of the armor stands:

/execute as @e[type=minecraft:armor_stand,name=Player] at @s run tp ~ ~ ~-1

You need to change the context so "~" represents the right location. You use "execute at" for that, like so:

/execute at @e{type=Armor_Stand,name=Player} run tp @e{type=Armor_Stand,name=Player} ~ ~ ~-1 

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.