I know the answer is probably posted somewhere obscure, but the only answer that I could find with 30 minutes of searching was something that I couldn't get to work. So, my issue is that when a player breaks a minecart with a chest, it should cancel the drops and drop a minecart with chest. So I thought it would look something like the code below, but I just can't get it to work. Help?
Code:
on death:
if victim is minecart with chest:
cancel the drops
give a minecart with chest to attacker