[SOLVED] Strange potion effect behavior.

Started by Constant Constantine on

Topic category: Help with modding (Java Edition)

Last seen on 00:11, 21. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] Strange potion effect behavior.
Tue, 06/20/2023 - 05:22 (edited)

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.

Edited by Constant Constantine on Tue, 06/20/2023 - 05:22
Last seen on 19:29, 11. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't see any screenshots.
Sun, 06/18/2023 - 20:06

I don't see any screenshots.

Last seen on 00:11, 21. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@ZarephLae I don't know why…
Mon, 06/19/2023 - 03:51

@ZarephLae I don't know why my screenshot was removed.

Last seen on 00:11, 21. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Klemen thanks! Though I…
Mon, 06/19/2023 - 18:42

@Klemen thanks! Though I still need help with the main topic of this thread.

Last seen on 19:29, 11. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So funny enough, someone…
Mon, 06/19/2023 - 21:51

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.

Last seen on 19:29, 11. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Under the potion item you…
Mon, 06/19/2023 - 21:59

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.

Last seen on 00:11, 21. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That seems to work with the…
Tue, 06/20/2023 - 00:32

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.

Last seen on 00:11, 21. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Alright, I don't need…
Tue, 06/20/2023 - 04:55

Alright, I don't need anything else. I figured out how to solve the rest of the problem on my own.

Last seen on 19:29, 11. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Btw, I briefly messed up…
Wed, 06/21/2023 - 14:54

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.

Last seen on 00:11, 21. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's alright, I knew what…
Thu, 06/22/2023 - 05:46

It's alright, I knew what you meant by the screenshot you showed me. Everything's all good now, thanks again.