How do I use attributes/attribute modifiers within java code to change a Minecraft players maximum health (not absorption effect or health boost)

Viewed 28

I'm creating an item that when equipped I want it to increase the player's max health and I also want it to be stackable with multiple items so it can't just be absorption or health boost. A lot of people have told me I need to use entity attributes but after hours of trying to figure out how to use them, I am at a complete loss. I'm on version 1.18.2 using forge.

1 Answers

Have you tried using MAX_HEALTH attribute? About adding them to items, I'm also looking into. I'll let you know if I find anything.

Related