When turning off hostile creatures' sounds in settings, Magma Cubes and Slimes still will produce movement, hurt and death sounds.
It appears that their sound effects are classified under Friendly Creatures
How to reproduce:
Turn off all sounds but Master Volume and Friendly Creatures in Settings
Summon Slimes/Magma Cubes and they will make sounds despite being hostile creatures
This bug is present in Versions: 1.16.5, 1.17.1 and 1.18 Pre-release 5
Environment
Windows 10 64 Bit
Java Version 8 Update 311
Vanilla Minecraft
Duplicate of MC-118616.