You can detect when a player breaks a block, and through some method of detection detect if it is a block they can mine. Then you cancel event, and give them the loot intended for that item. I cannot help you with the exact methods of detection or loot, as there are multiple ways to go about it, if you run into trouble, I recommend requesting in-game support.