The Bug:
The sounds of goats stomping and ramming aren't controlled by the "Friendly Creatures" sound slider and are instead controlled by the "Hostile Creatures" sound slider.
This is a problem and inconsistency because all mobs except goats have all their sounds assigned to one sound slider and not multiple of them. For example, friendly bee sounds and angry bee sounds are all controlled by one sound slider, that being "Friendly Creatures". Below I've constructed a table of all goat sounds and their assigned sound sliders for a visual comparison of the issue.
Affected Sounds:
Before reading the table, please note the following:
- Words colored in GREEN reflect the correct behavior.
- Words colored in RED reflect the incorrect behavior.
Goat / Screaming Goat Sound | Current Assigned Sound Slider | Expected Assigned Sound Slider | Notes |
---|---|---|---|
Milking sounds | Players | Players | See MC-243106 for an explanation as to why goat milking sounds should be controlled by the "Players" sound slider and not the "Friendly Creatures" sound slider. |
Ambient sounds | Friendly Creatures | Friendly Creatures | |
Death sounds | Friendly Creatures | Friendly Creatures | |
Eating sounds | Friendly Creatures | Friendly Creatures | |
Hurt sounds | Friendly Creatures | Friendly Creatures | |
Stepping sounds | Friendly Creatures | Friendly Creatures | |
Long jump sounds | Friendly Creatures | Friendly Creatures | |
Stomping sounds | Hostile Creatures | Friendly Creatures | |
Ramming sounds | Hostile Creatures | Friendly Creatures |
Steps to Reproduce:
- Navigate to the "Music & Sounds" settings menu.
- Turn the "Friendly Creatures" sound slider to "OFF".
- Turn every other sound slider to "100%".
- Exit this menu, summon a goat, and switch into survival mode.
- Make the gam ram you by altering its NBT data.
/execute as @e[type=minecraft:goat,limit=1,sort=nearest] run data modify entity @s Brain.memories."minecraft:ram_cooldown_ticks".value set value 1
- Listen closely as the goat stomps and rams you.
- Take note as to whether or not the sounds of goats stomping and ramming can be heard, (are controlled by the "Hostile Creatures" sound slider instead of the "Friendly Creatures" sound slider).
Observed Behavior:
The sounds of goats stomping and ramming aren't controlled by the "Friendly Creatures" sound slider and are instead controlled by the "Hostile Creatures" sound slider.
Expected Behavior:
The sounds of goats stomping and ramming would be controlled by the "Friendly Creatures" sound slider.
Code Analysis:
Code analysis by Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.18 using MCP-Reborn.
public class PrepareRamNearestTarget<E extends PathfinderMob> extends Behavior<E> { ... $$0.playSound((Player)null, $$1, this.getPrepareRamSound.apply($$1), SoundSource.HOSTILE, 1.0F, $$1.getVoicePitch()); ...
public class RamTarget<E extends PathfinderMob> extends Behavior<E> { ... $$0.playSound((Player)null, $$1, this.getImpactSound.apply($$1), SoundSource.HOSTILE, 1.0F, 1.0F); ...
If we look at the above classes, we can see that the sounds of goats stomping and ramming are sourced from SoundSource.HOSTILE, otherwise known as the "Hostile Creatures" sound slider.
Fix:
Simply changing where the sounds of goats stomping and ramming are sourced from to SoundSource.NEUTRAL (the "Friendly Creatures" sound slider) will resolve this problem.