How do I add Permanent buffs to my potion?

Started by Pixel_PedroYT on

Topic category: Help with modding (Java Edition)

Last seen on 19:26, 11. Feb 2024
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I add Permanent buffs to my potion?

Hi! I'm new to these forums but I already use MCreator for quite some time. I'm currently working on a mod in which I'm trying to add a potion that gives you permanent buffs such as 60 max health (3 health bars), deal 3 damage with your hand, be a bit quicker and take less damage, all of these things have effects for them (health boost, strength, speed and resistance) but I want it so even after dying you keep these buffs. Can anybody help me?

Last seen on 19:26, 11. Feb 2024
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
pls?
Wed, 06/23/2021 - 12:57

pls?

Last seen on 15:05, 6. Oct 2023
Joined Jan 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your Effect - Triggers - On…
Wed, 06/30/2021 - 18:53

Your Effect - Triggers - On Potion active tick.

Last seen on 19:26, 11. Feb 2024
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi, sorry for the late…
Fri, 07/02/2021 - 23:01

Hi, sorry for the late response but by doing that the effects wont keep after you die, I want it so when you die you still keep them.

The best thing I could find is that after drinking the potion, the game would keep running /effect commands, but  then it wouldn't work for health boost as it would keep setting your health do the value in the command, not letting you to heal.

Last seen on 16:16, 8. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know if you still…
Sat, 11/04/2023 - 05:53

I don't know if you still need this or not but one way to make this work is to make a player persistent logic/number variable, then run a procedure on player tick, if the variable is set to "true" apply the potion effects you want.
Then make it so that when the player drinks the potion it sets the variable to true for them and since it is player persistent it won't go away when they die.

Last seen on 19:26, 11. Feb 2024
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It worked! Thank you so much…
Sun, 12/03/2023 - 18:25

It worked! Thank you so much! Only thing is thatg, for some reason, the speed effect keeps flashing in my inventory between having it, and not having it, even though I set its time for 30 seconds. All other effects have their numbers flash between 29 and 30, while speed is the only one where the entire effect GUI box keeps dissapearing and reapearing. 

I have another item in the mod, which should give 120 ticks of speed on right click, but it only stays for a fraction of a second. I assume the length of effect for speed is bugged, but the potion still works anyway so thank you nonetheless.