Rip the people who are tabbed out and have the volume at 0%.
Something else to keep in mind is that only a little over 54% of players do actually have in-game sound enabled.
Though it is very hard to accurately measure the medium of studies and polls have been between 40%-60%
Usually, for moderation, it is always best to stick the sensory part of it to the visual. In my personal experience, the most effective in-game warnings are the ones that directly pop up over your screen with a big `Okay` button to press if the user understands & to make the popup go away.
My statistics have shown this to almost four-fold average monthly user in-game infraction rates. Which is a huge win for moderation on its own.
This is done in a way to let the user know, "Hey we don't want you doing that" but at the same time give them the action of closing that popup. To prevent the user from attempting petty excuses or try to start unnecessary arguments.
Somewhat of a subconscious admission to guilt if you will, which is why I believe it is effective for smaller infractions that do not need to be dragged further. Waisting both your company staff's time as well as cause an unwanted scene amongst the others in lobbies.
Though this is done not on Minecraft... I do not believe there is a way to incorporate something like that? Possibly only create a timed popup message in plain. Idk
Never been too involved with Java development so I am a bit unsure of the capabilities. Just thought I would share anyways :)