mojira.dev
MC-255436

Sound volume is clamped between 0 and 1 too late

When you use a /playsound command to play a sound at above 1 volume, it increases the range in which it can be heard; the sound volume itself gets clamped between 0 and 1, so it never plays louder than the actual audio file. However, the multiplication of the sound sliders happens before clamping, rather than after, making them useless with high-volume /playsound commands.

Steps to reproduce:

  1. Turn the hostile mobs slider to 1%

  2. /playsound entity.zombie.ambient hostile @s

  3. Note how silent it sounds ✔

  4. /playsound entity.zombie.ambient hostile @s ~ ~ ~ 1000

  5. Note how loud it is ❌

Expected behavior:
The volume would be low due to low % setting.

Actual behavior:
It's just as loud as 100%.

To fix this, all that needs to be done is moving the clamping to before the slider value multiplication.

Fixing this fixes MC-46634 as well as the responsiveness for the ender dragon's wings flapping sound.

Comments

migrated

I see now this is a duplicate of MC-98200, or rather the root cause, and would have the same fix.

Not sure how the mods wish to handle this situation.

ampolive

Thanks, resolved as a duplicate.

migrated

I'd suggest adding the cause, as described here, to that report then.
That report is also slightly misleading in the title, as it affects all sliders except master, as master turns the whole volume of the game down, not volume of sounds.

I'd highly suggest using this report's description instead, as it more clearly adresses the issue.

migrated

(Unassigned)

Confirmed

Sound

1.19.2

Retrieved