so when mob dies it has random item in inventory

you right click mob it opens it inventory then you can take loot

like game teridal

Various facets to that question make it more complicated than it seems.

But basically you would need:

A way to randomly give a dead body an item-

After that:

The rest is pretty simple, you override the right click to empty the body's contents into yours.