This mod limits you to a set number of lives per world. By default, when you die, you will lose half a heart of your permanent health, leaving you less and less hearts/HP after every respawn. When you finally run out of lives, depending on the config, you will be forced into Spectator mode or banned from the server for a set amount of time.
Use the command /ll or /limitedlives in chat to find out how many lives you have left or how long you have left to respawn.
To set a death count, do /ll <set> <player> <deaths>
Requires Fabric API and CompleteConfig. Forge version available here.