What I expected to happen was...:
What actually happened was...:
I died, but when I clicked respawn, I still had everything and I was still at the same location, But my character was red, as if it just died.
Steps to Reproduce:
1. Create an item which increases the amount of health you can get.
2. Create a /scoreboard objective which tracks health, and have it display on the sidebar.
3. Hold the special item you just created in your hand and let it increase your health until it gets above 20.
4. Select a different inventory slot (note how the scoreboard objective doesn't update!).
5. Update your health (drink a health potion or a damage potion, use the /effect command, or whatever).