A project I am working on has custom armor that, aside from standard armor, armor toughness, knockback resist, also modifies the player's max health when equipped. When the player disconnects with HP above the vanilla 20 while having that armor item equipped, their next login sees their HP reset to 20 despite the extra hearts showing up on their health bar.
It seems like the game on player connect is either setting any player's HP > 20 to 20, or the armor attribute modifiers are not immediately applied when they connect. Ideally, I aim for the correct HP to be set on login, but I can't seem to figure out the way to go about it. Any insight or pointers is appreciated.