So, straight to the point, I've been looking around the internetz and studying the docs, but I guess I'm just not able to figure out how the hell setMaxHealth works. I've create a wolf object and tried to use setMaxHealth to make it semi-invincible. However, the wolf just acts as if it had normal health. No errors whatsoever in the console. Thanks in advance.
@Code0 Just like vanilla if you give them healthboost it just adds some hearts. But you need to heal them after that. Or wait to let the regen do his thing
You have to set it's health to be the max. What you are currently doing is saying that in can be semi-Immortal, not that it will be.
If you want to make him semi invincible Couldnt you use EntityDamageEntity event and make it regen a set amount of hearts (in config) every hit? so say a diamond sword does 4 hearts of damage, you can make him heal 3 hearts every hit technically only doing 1 damage? Idk just a thought. not sure if i quite understand what you asked
Just so noone else tries to come up with something, I 'll try out @Funergy's answer. Thanks everyone for your help. I didn't think it would turn out to act like the health boost for players.