mojira.dev
MC-177741

Wither spawning sounds plays for all players regardless of distance

When playing multiplayer and somebody summons the wither the sound of the wither plays for all players no matter where they are in the world. In other words, the sound of a wither spawning (being released) is considered a global sound event.

Steps to Reproduce:

  1. Have two players join a server

  2. Position one player far away from the other player (hundreds, or thousands of blocks)

  3. Have one of the players create a wither using soul sand and wither skulls

Expected Result:

The sound would only play for the player actively engaging or intending to fight the wither boss. The sound is unnecessary for players which are very far away.

Observed Behavior:

The sound will play for all players, regardless of distance.

Related issues

Attachments

Comments

migrated
[media]
migrated

Well, the wither's sounds are very loud so it might be intended.

Avoma

Can confirm in 20w51a. This is the same case with activating an end portal and in my opinion, it seems intentional.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 1.18.2 and 22w16b. Here's a code analysis of this issue.

Code Analysis:

The following is based on a decompiled version of Minecraft 1.18.2 using MCP-Reborn.

net.minecraft.client.renderer.LevelRenderer.java

public class LevelRenderer implements ResourceManagerReloadListener, AutoCloseable {
   ...
   public void globalLevelEvent(int $i0, BlockPos $bp, int $i1) {
      ...
         ...
            ...
            if ($i0 == 1023) {
               this.level.playLocalSound(d4, d5, d6, SoundEvents.WITHER_SPAWN, SoundSource.HOSTILE, 1.0F, 1.0F, false);
            } else if ($i0 == 1038) {
               this.level.playLocalSound(d4, d5, d6, SoundEvents.END_PORTAL_SPAWN, SoundSource.HOSTILE, 1.0F, 1.0F, false);
            } else {
               this.level.playLocalSound(d4, d5, d6, SoundEvents.ENDER_DRAGON_DEATH, SoundSource.HOSTILE, 5.0F, 1.0F, false);
            }
         ...

If we look at the above class, we can see that withers spawning, end portals opening, and ender dragons dying, are all considered global level events (are included within the globalLevelEvent() method), meaning that they are broadcasted to all players.

windwend

Maybe related to MC-57057?

Avoma

I'm very inclined to believe that this is intentional since the WITHER_SPAWN sound event is considered a global level event, meaning that it can be heard by all players regardless of the dimension that they're in, or how far away from the sound origin point they are.

Some_One_YT

this isn't an issue and can be disabled in 1.19.3 by setting the gamerule globalSoundEvents to false

Minecraft386882

Can confirm in 1.21.3 

migrated

(Unassigned)

Confirmed

Sound

wither

1.15.2, 1.16.4, 20w51a, 21w03a, 1.18.2, ..., 1.20.4, 24w03b, 1.21, 1.21.3, 1.21.4

Retrieved