mojira.dev
MC-183502

The sounds for collecting honey in a bottle and collecting honeycomb with shears is categorised under friendly creatures

The Bug

When collecting honey from a bee's nest or hive in a bottle or by shearing, the 'bottle fills' or 'shears scrape' sound is played. The volume of this sound varies in accordance with the Friendly Creatures music and sounds slider, where as a block sound it should be controlled by the blocks slider.

Reproduce

  • locate a bee's nest or hive with honey level 5

  • Use an empty bottle item or a pair of shears on it with Blocks volume on 100% and Friendly Creatures volume on 0%,

  • Observe the lack of a sound for the action.

  • Repeat with the volume settings reversed and the sound will be audible.

Observed Behavior

The sound of collecting honey from beehives or bee nests is controlled by the "Friendly Creatures" sound slider.

Expected Behavior

The sound of collecting honey from beehives or bee nests would not be controlled by the "Friendly Creatures" sound slider.

Code Analysis

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

Linked issues

Attachments

Comments 13

Can confirm in 21w03a.

Can confirm in 1.16.5.

Can confirm in 21w16a.

Can confirm in 1.17.

Can confirm in 1.17.1.

3 more comments

Here's a code analysis along with a potential fix regarding this issue. The following is based on a decompiled version of Minecraft 1.17.1 using MCP-Reborn.

Code Analysis:

net.minecraft.world.level.block.BeehiveBlock.java

...
            $$0.playSound($$1, $$1.getX(), $$1.getY(), $$1.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.NEUTRAL, 1.0F, 1.0F);
            ...
            $$0.playSound($$1, $$1.getX(), $$1.getY(), $$1.getZ(), SoundEvents.BOTTLE_FILL, SoundSource.NEUTRAL, 1.0F, 1.0F);
            ...

If we look at the above class, we can see that honey collecting sounds are sourced from SoundSource.NEUTRAL, otherwise known as the "Friendly Creatures" sound slider.

Potential Fix:

Simply changing where honey collecting sounds are sourced from to SoundSource.PLAYERS should resolve this problem. The correct line of code within its class should look something like the following:

net.minecraft.world.level.block.BeehiveBlock.java

...
            $$0.playSound($$1, $$1.getX(), $$1.getY(), $$1.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.PLAYERS, 1.0F, 1.0F);
            ...
            $$0.playSound($$1, $$1.getX(), $$1.getY(), $$1.getZ(), SoundEvents.BOTTLE_FILL, SoundSource.PLAYERS, 1.0F, 1.0F);
            ...

Can confirm in 1.18.1.

Can confirm in 1.18.2 and 22w18a.

Can confirm in 1.19 and 1.19.1 Pre-release 1.

Can confirm in 1.19.2.

Laura Mann

v-armanv

Confirmed

Low

Sound

20w19a, 21w03a, 1.16.5, 21w16a, 1.17, ..., 1.18.2, 22w18a, 1.19, 1.19.1 Pre-release 1, 1.19.2

22w42a

Retrieved