This plugin simply does protect Sleepers from being killed by Animals.
The attacking animal will turn into "Flee"-mode once it attacks.
Per default this is activated for all players. This can be changed in config-file by setting Use Permissions to 'true'.
The check for sleeping on top of foundation can be activated with "Required to sleep ON foundation > true".
After a change run in console 'reload SleeperAnimalProtection'.
You need to grant permission (if active) to group or user:
'grant group default sleeperanimalprotection.active' OR
'grant user johndoe sleeperanimalprotection.active'
Default Config 'SleeperAnimalProtection.json':
"Permission name": "sleeperanimalprotection.active",
"Required to sleep ON foundation": false,
"Use permissions": false