In the Music & Sound Options tab, you can slide the "Players" sound bar all the way to 0%, which will mute the sound effects of eating. However, at the very last moment after having eaten something (at the same time that the hunger bars actually get replenished), a very abrupt clip of the sound will play for a fraction of a second. This seems unintended, and my guess is that a separate split-second sound clip may play in reaction regards to the hunger bars themselves filling, and that this split-second sound simply isn't classified to the "Players" sound bar slider.
Comments 5
Like Connor's suggestion, my assumption is that two events are occurring: 1) holding right click to eat, and 2) the effects of hunger bars being restored at the end of eating. Probably only the holding-right-click event is properly muted, leading to the final burp not having been muted as it is attached to separate code.
Here's a code analysis of this issue. The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn. Please note that I'm quite tentative about this analysis, although I'm persuaded to believe that this is likely the cause of the problem. 🙂
Code Analysis (tentative):
net.minecraft.world.entity.LivingEntity.java
public abstract class LivingEntity extends Entity {
...
public ItemStack eat(Level p_21067_, ItemStack p_21068_) {
if (p_21068_.isEdible()) {
p_21067_.gameEvent(this, GameEvent.EAT, this.eyeBlockPosition());
p_21067_.playSound((Player)null, this.getX(), this.getY(), this.getZ(), this.getEatingSound(p_21068_), SoundSource.NEUTRAL, 1.0F, 1.0F + (p_21067_.random.nextFloat() - p_21067_.random.nextFloat()) * 0.4F);
this.addEatEffect(p_21068_, p_21067_, this);
if (!(this instanceof Player) || !((Player)this).getAbilities().instabuild) {
p_21068_.shrink(1);
}
this.gameEvent(GameEvent.EAT);
}
return p_21068_;
}
...
If we look at the above class, we can see that the final clip of the eating sound is sourced from SoundSource.NEUTRAL
, otherwise known as the "Friendly Creatures" sound slider. I have no idea as to why this is the case, and why this only applies to the final clip of the eating sound but I can confirm that the above code is responsible for this problem.
Can Reproduce