The base values of attributes modified using the /attribute command are not retained and revert to their default values after a player’s death.
For example used one of these two commands
/attribute @p minecraft:generic.armor base set 20
/attribute @p minecraft:generic.max_health base set 40
after a death the player will return to 20 hearts and 0 armor points
Thank you for your report!
We're actually already tracking this issue in MC-179940, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki