Force quit the game after dying with items in your inventory, now when you rejoin the game you have duped the items in your inventory. 1 set of items will appear at you place of death, the other set in your inventory.
Environment
I have windows 10 OS, java edition minecraft, and it worked it singleplayer.
Works on console too