Check who destroyed foundation that bed was placed on?

Hi there!
So let's get straight into the question. Is it possible to check who destroyed a foundation that a bed was placed on? I have made a plugin that increases the attacker's score and disqualifies the victim. It works perfectly fine except for the bug that I just recently found. When someone destroyed the foundation that the bed is placed on, the attacker is null. Can I somehow check who destroyed the foundation underneath the bed and consider him/her the attacker?

Thanks in advance!
- Hyppa

you could make the bed not check for ground missing so it does not destroy the bed when ground is destroyed.. 

Ah, that is so smart of you! Thanks, ill do that!