-
Bug
-
Resolution: Incomplete
-
None
-
1.19.20.24 Preview, 1.19.11 Hotfix
-
None
-
Plausible
-
Multiple
Summary
Local coordinates do not work properly in functions.
How to reproduce
- Make a behavior package that contains a function named Test
- In function Test write "execute @s ~ ~1.5 ~ summon armor_stand ^ ^ ^5"
- Load the behavior pack in the cheat enabled archive
- Enter the game save
- Change your character's orientation in the game
- Run the command "/function Test" in the chat bar
- Repeat Step 5 to Step 6 for multiple times
Expected Results
Armor stands are spawned 5 blocks in front of you.
Observed Results
No matter how you change the orientation, the armor stand is spawned in one place.
Note
The BDS server is not affected.
If your horizontal orientation is ry and your vertical orientation is rx, and you are currently at (x,y,z), then after executing that function, the armor stand should be spawned at this position:
( -5*cos(rx)*sin(ry)+x , -5*sin(rx)+y+1.5 , 5*cos(rx)*cos(ry)+z )