You can't specify player as source of damage when applyDamage method is used on entities.
Code to reproduce:
anyEntity.applyDamage(5,{damagingEntity:mustBePlayer});anyEntity.applyDamage(5,{damagingEntity:mustBePlayer});Error message:
[media]
Pack to reproduce available: down below
Luckily this is not a bug, you are just missing the non-optional damage cause. e.g.