Started by
Cactus2.060
on
Topic category: Help with Minecraft modding (Java Edition)
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.
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.
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