Description
Died in lava, or got back to your grave a minute too late? Your stuff isn't necessarily gone. With this mod, Wandering Traders keep track of items you lost, and the next one you meet may offer to sell some of them back.
Unofficial port of Wandering Collector by Siphalor, for NeoForge and Fabric on 1.21.1, 1.21.11, 26.2 and 26.3. Please report bugs here.

How it works
Items you drop when you die, or that spill out of your inventory, remember that they were yours. If one of them is destroyed before anyone picks it up, it's added to your list of lost items. That means it despawned, burnt in fire or lava, got blown up, or fell into the void.
When you trade with a Wandering Trader, it adds a couple of your lost stacks to its normal trades. Each can be bought once, and other players only see their own lost items. Prices are in emeralds and depend on how full the stack is. Enchantments, names and anything else on the item come back with it.
Emeralds are never remembered, so a trader can't sell you your own currency. The wandering_collector:deny item tag controls that, and you can add more items to it with a datapack.
Config
Settings are in config/wandering_collector.json:
includeDroppedStacks: also remember items you threw away yourself. Defaultfalse.maxLostStackAmount: how many lost stacks are remembered per player. The oldest are forgotten first. Default 64.offerCreation: which lost stacks a trader offers first:NEWEST,OLDESTorRANDOM(default).combineLostStacks: merge lost stacks of the same item. Defaulttrue.buyBackTrades: how many lost stacks each trader offers you. Default 2.defaultPrices:minPriceandmaxPrice(32 to 64),priceItem(emeralds), and whether partial stacks cost less (scalePriceWithCount,minPriceScale).
FAQ
Client or server? The server needs it (or your game, in singleplayer). Players joining a server don't need it.
Does it need anything else? No.
Can I use it in my modpack? Yes, go ahead, no need to ask.
Apache-2.0. Developed with AI assistance. Source: https://github.com/traelmyx/wandering-collector-reborn