mojira.dev
MC-138832

Pitch and volume are ignored in the new sound packet

The volume and the pitch seem to be ignored in the new packet (https://wiki.vg/Pre-release_protocol#Entity_Sound_Effect) used to play a sound at an entity.


After some simple investigation, it seems like the bug should be easily fixed.

The names are from http://export.mcpbot.bspk.rs/

 

If we look at the following method, we can see that there is two parameters not being used (volume and pitch, indeed) while there is a constructor for EntityTickableSound that take them

 

net.minecraft.client.world.ClientWorld (the method called in the packet handler of "SSpawnMovingSoundEffectPacket")

public void playMovingSound(@Nullable PlayerEntity playerIn, Entity entityIn, SoundEvent eventIn, SoundCategory categoryIn, float volume, float pitch) {
   if (playerIn == this.mc.player) {
      this.mc.getSoundHandler().play(new EntityTickableSound(eventIn, categoryIn, entityIn));
   }
}

 

 

Comments 9

Please do not mark unreleased versions as affected.
You don't have access to them yet.

Please do not mark unreleased versions as affected.
You don't have access to them yet.

Does this issue still occur in the latest snapshot 19w12a?

I've just checked and yes, the sound is still bugged.

Please check if anything has changed for 1.16.2(-rc1), I currently do not have access to anything I can use to check myself.

I just checked and it's still occurring when using 1.16.5 - parameters are still not being used.
Would really appreciate a fix for that!

Seems like this was fixed in 21w18a.

Yep, this was resolved and can be closed.

 

@Override
public void playSound(@Nullable Player param0, Entity param1, SoundEvent param2, SoundSource param3, float param4, float var6) {
   if (param0 == this.minecraft.player) {
      this.minecraft.getSoundManager().play(new EntityBoundSoundInstance(param2, param3, param4, var6, param1));
   }

}

Fabien S.

(Unassigned)

Community Consensus

(Unassigned)

sound

Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w46a, Minecraft 19w12a, 1.15.2, 1.16.5

21w18a

Retrieved