Luckily this is not a bug, you are just missing the non-optional damage cause. e.g.
anyEntity.applyDamage(5, { cause: "magic", damagingEntity: mustBePlayer });
Luckily this is not a bug, you are just missing the non-optional damage cause. e.g.