You can't specify player as source of damage when applyDamage method is used on entities. Code to reproduce:
anyEntity.applyDamage(5,{damagingEntity:mustBePlayer});
Error message:
Pack to reproduce available: down below