Entity direction in deg: values changing when facing the same direction

Started by jopelle on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity direction in deg: values changing when facing the same direction
Sun, 04/12/2020 - 19:04 (edited)

Hello,

Entity direction in deg. is behaving in a way I don't really understand.

I'm sending to entity text containing  the entity yaw in deg: when I'm facing West, it texts 90 as it should but when I'm doing a 360, it texts -270 instead of 90 as before.

Why is the value not always between 0 and 360 or between -180 and 180?

Is there something I'm missing?

Thank you very much

 

(I posted a few hours ago a question pretty much about the same subject but not exactly the same question. I'm basically broadening my previous question)

 

EDIT: I'm using modulo to keep the value between 0 and 360 but I'm still wondering why I have such strange values

Edited by jopelle on Sun, 04/12/2020 - 19:04
Joined Aug 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Values aren’t always between…
Mon, 04/13/2020 - 03:40

Values aren’t always between 0 and 360 because, I think, when you turn, it only add or remove degrees without checking if the value is lower than 0 or higher than 360. 

Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok thank you!
Mon, 04/13/2020 - 14:10

Ok thank you!