RNG for Potion Effects Not Working

Started by Cardioponics on

Topic category: Help with MCreator software

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RNG for Potion Effects Not Working

I got back into modding recently, and I'm making a mod that has potion effects attached to items rather than potions themselves. An item I implemented was meant to apply a random potion effect from a set of positive and negative effects. Occasionally, I run into this issue where if I try to clear the effect, the timer continues to tick down until it gets stuck at 0 in the HUD and player inventory. Sometimes, the applied effect doesn't work, but will still appear in the HUD/inventory. Also, it will sometimes choose 3 potion effects instead of just 1. When I do not use this system and just apply the potion effects directly, everything is completely fine and works as intended.

I tried setting the effects to ambient, but even then, they didn't work. I am using MCreator Version 2022.3 for 1.19.2 if that helps at all. Any help is appreciated, thank you!


 

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is a client/server…
Wed, 09/10/2025 - 20:59

This is a client/server desynchronization issue. To fix it, put the randomization and the potion effect applications inside an if block with the condition "not is provided world client-side" that should fix both problems (the infinite potions and the random potion amounts).