Started by
Pixel_PedroYT
on
Topic category: Help with Minecraft modding (Java Edition)
Hi! I'm new to these forums but I already use MCreator for quite some time. I'm currently working on a mod in which I'm trying to add a potion that gives you permanent buffs such as 60 max health (3 health bars), deal 3 damage with your hand, be a bit quicker and take less damage, all of these things have effects for them (health boost, strength, speed and resistance) but I want it so even after dying you keep these buffs. Can anybody help me?
pls?
Your Effect - Triggers - On Potion active tick.
Hi, sorry for the late response but by doing that the effects wont keep after you die, I want it so when you die you still keep them.
The best thing I could find is that after drinking the potion, the game would keep running /effect commands, but then it wouldn't work for health boost as it would keep setting your health do the value in the command, not letting you to heal.
I don't know if you still need this or not but one way to make this work is to make a player persistent logic/number variable, then run a procedure on player tick, if the variable is set to "true" apply the potion effects you want.
Then make it so that when the player drinks the potion it sets the variable to true for them and since it is player persistent it won't go away when they die.
It worked! Thank you so much! Only thing is thatg, for some reason, the speed effect keeps flashing in my inventory between having it, and not having it, even though I set its time for 30 seconds. All other effects have their numbers flash between 29 and 30, while speed is the only one where the entire effect GUI box keeps dissapearing and reapearing.
I have another item in the mod, which should give 120 ticks of speed on right click, but it only stays for a fraction of a second. I assume the length of effect for speed is bugged, but the potion still works anyway so thank you nonetheless.