Started by
Angel_Knight
on
Topic category: Help with Minecraft modding (Java Edition)
Hello,
i want to make an item that when you hold in your main hand gives you extra live, but when you scroll away and dont hold it in your hand or dont have it in your inventory, your life goes back to 10 hearts,
i tried a little bit and the only thing i am able to do is, that when u have it in your main hand you get more health, but the lifes stay that and dont go away anymore,
if anyone could help me i would appreciate it, thanks
There's probably a couple of ways you could do this, but here's what I'd recommend:
There'll be a bit of a cooldown, (if they scroll away or drop the item, they'll still have absorption for a little bit before the effect wears off.) I'm also not quite sure how this would work if the player is injured; you might have to add something that checks the player's health and heals them instead of granting the effect if their health is below 20. (10 hearts.)
How do i check for the effect?
and what if it should be like max health, like normal hearts and not absorbtion hearts?
Use health boost effect instead
jk