So im currently trying to create a command block that simulates muzzle flip for a crossbow machine gun. All is going smooth except for a string that seems like it should work but dosen't. My command is
(/)execute as @a[checking for specific player] run tp @s ~ ~ ~ ~ ~-10
The first three tildas should represent x y z coordinates of the player executing, but they always teleport me to the command block instead. This would be the same behavior as if i didn't precede the command with an execute, and unless i am confused, the execute command should use all the data from the specified players location. Is there something im missing? How would i get the command to use the coordinates of the specified player, and / or is there a different command (other than tp) that i could use to change a players vertical head alignment?
Btw, this command works perfectly when executed out of text chat, but goes balistic in a command block
UPDATED --- I AM A DUMMY
execute AS and execute AT are different commands, and do different things. For my fellow digital dummies ill explain- execute AS is for player id and stuff, execute AT is for world location. I was under the impression that execute as would do both, but it doesn't. Let my blunder be a reminder to do research even after failure, because it's likely that it was just you being slow. Goodbye and good coding