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 09:45, 3. Jan 2022
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 09:45, 3. Jan 2022
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"?

Last seen on 09:45, 3. Jan 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks for attention, but it…
Fri, 07/02/2021 - 00:12

Thanks for attention, but it doesn't quite help me.

Even though I can't test it for now(because my windows broke, disc got unallocated and I lost my workspace, which needed this function) I already see, that replacing MCreator's operation with command doesn't quite change anything. I think it still can't determine the source of pitch/yaw change like     provoked by player themselves or by the same operation, that added addictional degrees.

SO the problem is that I want to make a procedure, that will run operation, that will check if:

Player's pitch or yaw has changed

And then change the pitch, BUT not make an endless loop and not change until the player does it themselves, not the command.

Because seemingly I already knew how to change the pitch or yaw of the player and how to check for it, but player just was spinning around once they look at other direction. Because the procedure checks if the player has moved his head and then adds addictional 9 degrees to it, but THESE degrees are also counted so player's head moves once more, but I want to make something, that will not make an endless loop. Can you help me with that?

Last seen on 02:40, 4. Jan 2022
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hmm maybe the Goldfuscate…
Fri, 07/02/2021 - 02:24

Hmm maybe the Goldfuscate plugin could help? I honestly have no idea how to do this otherwise