Just one other thing, not really related but how would I make this if statement only run once because at the moment the sound is continuously played until the entity no longer has an attack target.
if (this.getAttackTarget() != null)
{
this.playSound("mob.zombiepig.zpigangry");