When /execute is used to execute commands that require coordinates, the command uses the coordinates of the player or the command block that entered the /execute command instead of the target's coordinates.
For example, say a command block contains the following command:
/execute @e[type=chicken] ~ ~ ~ /setblock ~ ~1 ~ minecraft:stone
When powered, the command block will create the stone block above itself instead of creating it above the chicken. The same happens when the player enters the same command (ie the block is created in the player's head).
The same problem arises when the command executed by /execute targets another entity like this one:
/execute @e[type=chicken] ~ ~ ~ /scoreboard players tag @e[type=armor_stand,r=2] add test
The /scoreboard command tags armor stands within two blocks of the command block or the player that entered the /execute command, and not the chicken targeted by /execute.
Thank you for your report!
However, this issue has been closed as a Duplicate of MC-117319.
It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki