Found this bug by running a datapack with two functions, "namespace:trigger" and "namespace:raycast", for a total of three commands. Contents of "namespace:trigger": execute as @s anchored eyes positioned ^ ^ ^1 run function namespace:raycast Contents of "namespace:raycast": execute run particle flame ~ ~ ~ 0 0 0 0 1 execute as @s positioned ^ ^ ^0.1 run function namespace:raycast
The intuitive and expected result after calling "namespace:trigger" with the function command in-game would be a line of flame particles drawn from the user's eyes onwards in the direction they are facing. The trigger function should set the initial base for the local coordinates to the user's eyes, then run the recursive raycast function which spawns a flame particle at the local coordinates, then shifts the local coordinates forward by 0.1 blocks and runs itself again.
What happens instead is a line of flame particles are drawn upwards in intervals of the player's height (from feet to eyes). Similar to what CreeperMagnet_ said, what is likely happening in this scenario is that every time the raycast function is called, the local coordinates are raised by the height of the user's eye level as though the anchored subcommand is being called upon again after repositioning. In the comments section of MC-124381, Aaron Rhodes suggested adding "anchored feet" to counteract the "anchored eyes" in the command. This fixes the problem, supporting that the cause of the issue lies somewhere with the execute command repeatedly "anchoring" the local coordinates to a height corresponding to the user's eye level every time the following commands are run. (I would also like to add that although inserting "anchored feet" may resolve the issue in some circumstances, it's a bit of an unintuitive solution.)
Seems to affect 1.14.4.
Found this bug by running a datapack with two functions, "namespace:trigger" and "namespace:raycast", for a total of three commands.
Contents of "namespace:trigger":
execute as @s anchored eyes positioned ^ ^ ^1 run function namespace:raycast
Contents of "namespace:raycast":
execute run particle flame ~ ~ ~ 0 0 0 0 1
execute as @s positioned ^ ^ ^0.1 run function namespace:raycast
The intuitive and expected result after calling "namespace:trigger" with the function command in-game would be a line of flame particles drawn from the user's eyes onwards in the direction they are facing. The trigger function should set the initial base for the local coordinates to the user's eyes, then run the recursive raycast function which spawns a flame particle at the local coordinates, then shifts the local coordinates forward by 0.1 blocks and runs itself again.
What happens instead is a line of flame particles are drawn upwards in intervals of the player's height (from feet to eyes). Similar to what CreeperMagnet_ said, what is likely happening in this scenario is that every time the raycast function is called, the local coordinates are raised by the height of the user's eye level as though the anchored subcommand is being called upon again after repositioning. In the comments section of MC-124381, Aaron Rhodes suggested adding "anchored feet" to counteract the "anchored eyes" in the command. This fixes the problem, supporting that the cause of the issue lies somewhere with the execute command repeatedly "anchoring" the local coordinates to a height corresponding to the user's eye level every time the following commands are run. (I would also like to add that although inserting "anchored feet" may resolve the issue in some circumstances, it's a bit of an unintuitive solution.)