How to make the effect of the potion be immune to milk?

Started by JPZamps on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make the effect of the potion be immune to milk?

I saw a post on how to do this using nbt tags, the only problem is that what should happen would be for the tag to disappear when the potion expires, but the milk makes the potion expire what to make it go over the nbt tag

I think that's what happens

1.Player gets the potion ''A'' and now the NBT tag ''effect A'' is true

2.the word checks player ticks and with they have ''effect A'' true they will give to the player potion ''A''' 

3.But it needs a way to make the ''effect A'' goes to true to false

4.So i make when the potion expires the NBT ''effect A'' goes to true to false ending the potion effect

5.when he drinks milk it removes the effects of the potion which is the same as making it expire, there is no difference between the potion expiring or it being removed from the player, by doing so the milk removes the potion and removes the NBT tag

Maybe there is a simpler solution but I don't see it here, could someone help me?

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i think that what you can do…
Wed, 12/14/2022 - 22:58

i think that what you can do is instead of a continuous timer set a timer that will give the effect repeatedly every tick than even if you drink milk the effect will be given again. I hope i could help you.

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
actually it would work for…
Tue, 12/20/2022 - 22:28

actually it would work for some effects only, those that do something when the potion expires would fall into the same problem I described above