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).

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks Catnip, that resolved…
Sat, 09/13/2025 - 10:30

Thanks Catnip, that resolved the issue!

On the same topics of potions, is there a way to hide potion effects entirely from the player inventory? In the normal HUD you can, but I want the effects to be hidden from the player. That, and I have custom effects that add vanilla potions, and I don't want them to be cluttering up the inventory screen with 20 icons stacked on top of one another. 

If I should post this as its own forum, let me know and I will. Thank you so much!

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry for the late response…
Thu, 09/18/2025 - 13:00

Sorry for the late response.

There is a checkbox for custom potion effects to prevent them from showing up in the inventory as well as the normal HUD. I don't know if it is in version 2022.3 though, it may be, I'm not sure. That is the only way I know of to prevent potion effects from showing up in the inventory.

(also, the checkbox is on the properties page of the custom potion effect, and it is called 'Render active potion effect status in inventory:' at least in MCreator version 2025.2 but it may not be a feature of 2022.3)

I hope this is at least able to help some.

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I actually meant disabling…
Mon, 09/22/2025 - 03:59

I actually meant disabling the active potion effect of the vanilla potion effects in the inventory. You can do so in the HUD, but not the inventory itself. The custom effects are more important to see as they perform other actions besides from applying Minecraft's vanilla potion effects, such as some giving the player immunities to other effects. That property is in 2022.3, though!