Every time you die, a grave is placed at your position. To retrieve your items just break the grave. There is also a config option to get your items back by sneaking on the grave (1.16.3+ only).
When you right-click the grave it will show information regarding the death of the player.
Since version 1.16.3-2.0.0 the grave is now able to store your items back into their original slots.
Everytime you die you get an obituary. If you don’t want that you can disable it in the config.
If you don’t want to keep the obituary after you recovered your items, you can enable the automatic removal in the config.
Naming the Grave
If you break the grave with silk touch, you get it dropped as an item. You can also craft graves.
Naming the grave in an anvil, allows you to have custom text displayed on your grave.
There are several things you can change in the configs:
Recovering Lost Items (1.16.3+)
If you somehow lost your items you can recover them with the recover command.
The syntax is /restore
The parameter player is the player whose inventory should get restored.
The parameter death_id is the ID of the death. You can find it out by enabling advanced tooltips (F3 + H) and opening the obituary. The death ID also gets written into the logs if a grave couldn’t get placed.
The last parameter defines if you want to get the players inventory replaced (Overwritten) or added (Just adds the items to the players existing inventory).
You can also get a pre made restore command by sneaking and right-clicking the obituary as an admin.
If you die inside a block, the grave is placed at the next empty space above your location. If there is no free block above your position, or you are above the build limit, your items drop as usual.
If you fall into the void, the grave is placed at Y=1. If there is no free space it will get placed at the next free spot above.