Topic category: Help with Minecraft modding (Java Edition)
So, I'm working on a liquid that when ingested, (via drinking or by being submerged in it) gives the entity that is affected by it; a potion effect that is supposed to apply a different potion effect when it expires. In the following screenshot, I am inside of said liquid, which is supposed to apply "Jim" as the base potion effect, which is then supposed to apply "Margaret" when upon expiring. For whatever reason, the liquid applies both Jim and Margaret, instead of just Jim. (For context, when I am out of the liquid, Jim runs out and applies Margaret, as it should. My problem is strictly with the liquid applying both effects.) I would like to know what could be causing this and what I can do to fix it.
For further context, they originally were named "placeholder 1" and "placeholder 2" (hence the "P" as their icons) but, I changed their name thinking that maybe the code was confused by similar names, but that wasn't the case. I then recreated the potion effects, so they would have very different IDs, with me thinking it was a problem with the IDs instead, but that too, still wasn't the case. I also tried changing the duration of the two effects to see if that would do anything, it did not. So, I'm kind of stuck as to what to do here because it would seem no matter what I try, the liquid still gives me both.
(Note: The green bordering the wood in the image is the surface of the liquid I was in. I do not have an underwater overlay for this liquid yet.)
Edit: Hopefully the screenshot stays up this time.
I don't see any screenshots.
@ZarephLae I don't know why my screenshot was removed.
https://mcreator.net/forum/20773/how-can-i-upload-image
@Klemen thanks! Though I still need help with the main topic of this thread.
So funny enough, someone else recently asked a very similar question that is near identical so I'll share a screenshot of a procedure I've done up. It should do exactly what you need it to.
In this screenshot, the global trigger is "Player finishes using item" which would be the potion being drunk. What you want to do is select the main potion effect that causes the other effects under the first "Add potion" block.
In Minecraft, 20 ticks is one second so do math to figure out how long you want it going for. Then under the "Wait" block, make the tick just one more than what you set the first "Add potion" block to be. So if you wanted your main effect to last 30 seconds, I would specify "600" ticks in the first "Add potion block" then specify "601" ticks in the "Wait" block.
Then all the other "Add potion" blocks in the "do" of the "Wait do" block will be whatever effects you're triggering.
I haven't tested this but it should achieve exactly what you need. You will need to link this procedure to the potion item you made in question so when you "drink" the potion" it will trigger the main effect you created.
Under the potion item you made, go to triggers and there will be a trigger that says, "Player finishes using item". Apply this procedure to that slot.
That seems to work with the drinkable form, but also gives me an idea as to what I can do with the block version of the liquid. Thanks, ZarephLae! I'll update this thread if I need help with anything else.
Alright, I don't need anything else. I figured out how to solve the rest of the problem on my own.
Btw, I briefly messed up. For the procedure, the global trigger shouldn't be when player finishes item.
As long as it's added under the player finishes item trigger for the item in question, it will work.
It's alright, I knew what you meant by the screenshot you showed me. Everything's all good now, thanks again.