Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaw and pitch changes apply incorrectly to player entities. #2031

Open
YotaXP opened this issue Jan 31, 2025 · 0 comments
Open

Yaw and pitch changes apply incorrectly to player entities. #2031

YotaXP opened this issue Jan 31, 2025 · 0 comments

Comments

@YotaXP
Copy link

YotaXP commented Jan 31, 2025

When changing a player entity's facing direction with modify(_, 'location', ...), modify(_, 'yaw', ...), or modify(_, 'pitch', ...), the entity's initial facing direction is influencing the result. Furthermore, modifying 'yaw' also affects pitch, and vice versa.

For example, running following command while I have a yaw and pitch of 15, 10 adjusts my yaw AND pitch to 17, 20.
/script run modify(player(), 'yaw', 2)
I would expect my yaw and pitch to be 2, 10 afterwards.

This only occurs with player entities from what I've seen. Setting the pitch and yaw of mobs works correctly.

Workarounds:

set_direction(player, yaw, pitch) ->
    modify(player, 'location', ...player~'pos', yaw - player~'yaw', pitch - player~'pitch')

set_yaw(player, yaw) ->
    modify(player, 'location', ...player~'pos', yaw - player~'yaw', 0)

set_pitch(player, pitch) ->
    modify(player, 'location', ...player~'pos', 0, pitch - player~'pitch')

This appears to be a regression as it did not always behave this way.

I have tested and found this behavior in the following versions:

Minecraft: 1.21.3 - Fabric: 0.16.9 - Carpet: 1.4.158
Minecraft: 1.21.4 - Fabric: 0.16.10 - Carpet: 1.4.161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant