Started by
Blockadile
on
Topic category: Help with Minecraft modding (Java Edition)
im trying to make a food item that give you a potion effect (similarly to a golden apple) but gives you a set of diifferent effects after the longest one runs out, does anyone know how to do this?
I would make two procedures. One that simply gives the main potion effect when eaten. Then a second procedure that gives the other potion effects when the main one is depleted. I guess you could do it all in one procedure but that's how I would do it.
So below is my idea of what it would like like.
In the "Add potion" statement, select the main effect that is supposed to afflict the other effects. Set it for the "Has active potion" statement nested inside the if statement as well. Then under the "Add potion" statement nested in the "Do" statement, select all the effects you want to trigger.
Note: The "Wait {ticks} do" ensures that the effects will trigger at the right time. Basically, without it, the procedure will apply the main effect then check to see if it's gone but since it just got applied, the procedure will end. What you need to do is set the ticks inside the "Add potion" statement that triggers the main effect that was first stated to match the same amount of ticks in the "Wait do" statement. Maybe bump up the tick in the "Wait do" statement by 1. So if you want the main effect to last 30 seconds, set it to 600 ticks (20 ticks is a second in Minecraft) then set the "Wait do" statement to 601 so right after it ends, then it will check for the player and see if they have the main effect, if not, it'll apply the potion effects you specify.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Actually, as I'm writing this. I'm realizing there's a much simpler way to do this and I'm over-complicating things.
This is much simpler and makes more sense. I was treating the first one as if they were two different procedures, sorry. Just set it up like this and in my mind, it should work? I'm not sure as I've never tested it but to me, it makes perfect sense. Any further help, just reply or message me on Twitter, @ZarephLae.