mojira.dev
MC-236515

The "minecraft:item.elytra.flying" sound cannot be heard by other players when flying with elytra

The Bug:

The "minecraft:item.elytra.flying" sound cannot be heard by other players when flying with elytra.

Steps to Reproduce:

  1. Get two players and label them "Player A" and "Player B".

  2. Get "Player A" to stand still and have "Player B" fly past them with elytra.

  3. Get "Player A" to listen closely as this happens.

  4. Take note as to whether or not the "minecraft:item.elytra.flying" sound can be heard by other players when flying with elytra.

Observed Behavior:

The "minecraft:item.elytra.flying" sound cannot be heard by other players.

Expected Behavior:

The "minecraft:item.elytra.flying" sound would be able to be heard by all players.

Code Analysis:

Code analysis by @unknown can be found below.

The following is based on a decompiled version of Minecraft 1.19 Pre-release 4 using Mojang mappings.

net.minecraft.client.resources.sounds.ElytraOnPlayerSoundInstance.java

public class ElytraOnPlayerSoundInstance extends AbstractTickableSoundInstance {
   ...
   private final LocalPlayer player;
   ...
   public ElytraOnPlayerSoundInstance(LocalPlayer localPlayer) {
      super(SoundEvents.ELYTRA_FLYING, SoundSource.PLAYERS, SoundInstance.createUnseededRandom());
      this.player = localPlayer;
      ...

If we look at the above class, we can see that this sound event is only played to the local player (the player who is producing the sound) therefore making it not hearable by other players.

Linked issues

Attachments

Comments 0

No comments.

Avoma

(Unassigned)

Confirmed

Gameplay

Normal

Networking, Sound

elytra

1.17.1, 1.18 Pre-release 1, 1.18 Pre-release 5, 1.18, 1.18.1, ..., 1.19.3, 1.19.4, 1.20.1, 1.21, 1.21.4

Retrieved