How to adding a potion that increases its effects over time

Started by Cactus2.060 on

Topic category: Help with modding (Java Edition)

Last seen on 19:37, 12. Jun 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to adding a potion that increases its effects over time

I am trying to create a 10 minute potion that every 2 minutes adds an effect, for example 8 minutes = weakness, 6 minutes = slowness, 4 minutes = nausea, 2 minutes = blindness and when the effect ends death. I would also like to make this effect erasable with another potion. can someone tell me if it can be done and in case help me. sorry for my bad English.

Last seen on 14:17, 8. Aug 2023
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can play with codes…
Sun, 05/22/2022 - 18:01

You can play with codes aswell, here you go:

https://we.tl/t-iwkMuBCdNj

 

Put this .rar file to your workspace folder and then extract it.

Last seen on 13:58, 21. Jan 2023
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if it is for 10 minutes then…
Mon, 05/30/2022 - 17:52

if it is for 10 minutes then you can just have a on potion active tick and check for this ((((60*60)*2)*<curse level>) >= <remaining effect ticks>) then just run your desired code for the stage it is at, this will also just give the effects every tick so they are cleared instantly by your other potion. Then to stop milks effects just make a player lifetime variable that is a booleen and another variable that is a current curse ticks that is a int and is a player lifetime variable then just save them like this, the booleen at the effect start and the current ticks by using the on potion active tick function and saving it, then just have the 'on effect end' trigger check the remaining ticks and check if they are below or at 60 ticks and that the cure potion is not active then kill them but if they are above 60 ticks remove 60 from the tick counter and then activate the effect again with the new remaining ticks. if they have the cure then end the function completely and remove the effect will be gone