mojira.dev
MC-251832

Goat Horn sounds are controlled by the Jukebox/Note Blocks sound slider

The Bug

The goat horn sounds are controlled by the Jukebox/Note Block sound slider

Reproduce

  • Turn off Jukebox/Note Block sounds

  • Get a Goat Horn

  • Play it

Observed Result

It didn't play any sound when the Jukebox/Note Block slider was off

Expected Result

It wouldn't be controlled by the Jukebox/Note Block sound slider instead controlled by the Players slider since the sound is being produced by a player

Code Analysis

Code analysis by @unknown can be found in this comment.

Attachments

Comments 6

I can confirm that this occurs, but this might be intended because goat horns are somewhat musical.

I can confirm this behavior in 1.19 Pre-release 2. Here's a code analysis regarding this issue.

Code Analysis:

The following is based on a decompiled version of Minecraft 1.19 Pre-release 2 using Mojang mappings.

net.minecraft.world.item.InstrumentItem.java

public class InstrumentItem extends Item {
   ...
   private static void play(Level level, Player player, Instrument instrument) {
      SoundEvent soundEvent = instrument.soundEvent();
      float f = instrument.range() / 16.0f;
      level.playSound(player, player, soundEvent, SoundSource.RECORDS, f, 1.0f);
      level.gameEvent(GameEvent.INSTRUMENT_PLAY, player.position(), GameEvent.Context.of(player));
   }
   ...

If we look at the above class, we can see that the sounds of instruments (goat horns) playing are sourced from SoundSource.RECORDS, otherwise known as the "Jukebox/Note Blocks" sound slider.

Potential Fix:

Simply changing where the sounds of instruments (goat horns) playing are sourced from to SoundSource.PLAYER (the "Players" sound slider) should resolve this problem.

Can confirm in 1.19 Release Candidate 2.

[media][media][media]

Can confirm in 1.19.

Can confirm in 1.19.1.

Can confirm in 1.19.2.

anthony cicinelli

(Unassigned)

Confirmed

Normal

Sound

22w19a, 1.19 Pre-release 2, 1.19 Pre-release 3, 1.19, 1.19.1, 1.19.2

Retrieved