How to make a potion, that makes your head rotations rough?

Started by MargoxaTheGamer on Sun, 04/25/2021 - 10:33

Topic category: Help with modding (Java Edition)

Last seen on 08:41, 9. Jun 2021
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make a potion, that makes your head rotations rough?
Tue, 05/18/2021 - 07:40 (edited)

Yes, this may sound like a very weird and non-understandable request, but I'll try to explain everything as clear as I can. Basically, I want to make a potion, that does this:

When player's head pitch or jaw changes(not by a procedure, but when the players ACTUALLY moves their head by themselves) it will add addictional 9 degrees to it, depending onto which side player moved the head, if he moved it to right it adds 9 degrees to the rotation to right, but if left, then 9 addictional degrees to left and same to up and down.

Basically, I want to make a potion, that makes player's head pitch and yaw change be less smooth and more rough.

I tried all different ways to do this with complex procedures, that run each 20th tick or each 10th tick and ended up using 3 local variables and 2 NBTTags, but the result is either:

- Nothing happens, when potion is active

OR

- Player's head constantly moves even when she's not moving it(possibly because procedure checks, if player's head was moved and moves it stronger, but it makes it move even more and endless loop happens, however I tried to use addictional local variable to check if the procedure changed the head pitch and yaw or the player herslef, but it didn't help)

OR

- The player always ends up moving the head to the same spot

 

Any help would be appreciated! It would be even better if you'd suggest me your procedure.

Edited by MargoxaTheGamer on Tue, 05/18/2021 - 07:40
Last seen on 08:41, 9. Jun 2021
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Is there a moderator, that…
Mon, 05/17/2021 - 10:34

Is there a moderator, that could help me with moving the topic from "Help with MCreator software" to "Help with modding"?