In my EntitySMGRounds do I have to have "this.playSound(ModSoundEvent.impact, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));"
in a certain line? if I put it after the super(line 86), the sound spams, but if I have it after if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
the sound doesn't play at all
(I've updated the pastebin with my entitysmgrounds class)
EDIT: Fixed it! I had to
protected void onHit(RayTraceResult raytraceResultIn) {
super.onHit(raytraceResultIn);
this.playSound(ModSoundEvent.impact, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
Entity entity = raytraceResultIn.entityHit;
if (entity != null)
{
float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
int i = MathHelper.ceil((double)f * this.damage);
if (this.getIsCritical())
{
i += this.rand.nextInt(i / 2 + 2);
}
}
}
I've updated the pastebin again incase anyone wants to use my SMGRounds for any reason