Minecraft – Auto Aim Bow code, Teleport Command Minecraft 1.13

minecraft-commandsminecraft-java-edition

With Minecraft's new patch, I cannot simply copy down command block code for creating a mechanism that will rotate an arrow towards the nearest player. I have been testing this out in single player with a repeating non Redstone activated command block with the code of:

teleport @e[type=minecraft:arrow] ^ ^ ^ facing entity @p feet 

The teleport feature is new to this patch (to my understanding) so please help me understand if I'm doing this right.

Best Answer

teleport works relative to the executioner, no matter if ~ ~ ~ or ^ ^ ^.

So you want:

/execute as @e[type=minecraft:arrow] at @s run teleport @s ~ ~ ~ facing entity @p

Note that this will neither redirect the arrow towards you (it has a Motion tag and to change that properly you need sinus calculation), nor will it actually rotate the tip of the arrow towards you, because facing directions of arrows are always a bit weird.