-
Bug
-
Resolution: Fixed
-
Minecraft 15w44b, Minecraft 15w45a, Minecraft 15w46a, Minecraft 15w47a, Minecraft 15w47b, Minecraft 15w47c, Minecraft 15w49a, Minecraft 15w49b, Minecraft 15w50a, Minecraft 15w51a, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w03a, Minecraft 16w04a, Minecraft 16w05a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, Minecraft 16w07b, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w15a, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w38a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w16b, Minecraft 17w17a, Minecraft 17w17b, Minecraft 17w18a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 3, Minecraft 1.12 Pre-Release 4, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 18w46a
-
Confirmed
The bug
Ambiance / cave music can play far away from the player. This way the player might hear it less often than it should appear.
Report history
This report used to include in-game and title music as well. These were fixed in previous versions.
Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
The problem is that the method net.minecraft.client.multiplayer.WorldClient.playMoodSoundAndCheckLight(int, int, Chunk), which plays the ambient cave sound, is called with chunk coordinates of all visible chunks and only tests if the position tested is at least 2 meters away. This means the position can be hundreds of blocks away.
protected void playMoodSoundAndCheckLight(int p_147467_1_, int p_147467_2_, Chunk chunkIn) { super.playMoodSoundAndCheckLight(p_147467_1_, p_147467_2_, chunkIn); if (this.ambienceTicks == 0) { this.updateLCG = this.updateLCG * 3 + 1013904223; int i = this.updateLCG >> 2; int j = i & 15; int k = i >> 8 & 15; int l = i >> 16 & 255; BlockPos blockpos = new BlockPos(j + p_147467_1_, l, k + p_147467_2_); IBlockState iblockstate = chunkIn.getBlockState(blockpos); j = j + p_147467_1_; k = k + p_147467_2_; // Old code //if (iblockstate.getMaterial() == Material.AIR && this.getLight(blockpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, blockpos) <= 0 && this.mc.player != null && this.mc.player.getDistanceSq((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D) > 4.0D) //{ // this.playSound((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, SoundEvents.AMBIENT_CAVE, SoundCategory.AMBIENT, 0.7F, 0.8F + this.rand.nextFloat() * 0.2F, false); // this.ambienceTicks = this.rand.nextInt(12000) + 6000; //} if (this.mc.player != null) { double distanceToPlayerSquared = this.mc.player.getDistanceSq((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D); // The player cannot hear the sound if it is played more than 15 (sqrt(255)) blocks away if (distanceToPlayerSquared > 4.0 && distanceToPlayerSquared <= 255.0 && iblockstate.getMaterial() == Material.AIR && this.getLight(blockpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, blockpos) <= 0) { this.playSound((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, SoundEvents.AMBIENT_CAVE, SoundCategory.AMBIENT, 0.7F, 0.8F + this.rand.nextFloat() * 0.2F, false); this.ambienceTicks = this.rand.nextInt(12000) + 6000; } } } }
- is duplicated by
-
MC-92138 In-game music problem
- Resolved
-
MC-92278 Music not playing
- Resolved
-
MC-92353 No Music
- Resolved
-
MC-92488 Title Screen Music Never Plays
- Resolved
-
MC-92506 Music does not play
- Resolved
-
MC-92816 sounds and music error.
- Resolved
-
MC-92985 Music don't play on world and title.
- Resolved
-
MC-93099 No music in game.
- Resolved
-
MC-93168 Ambient cave sounds don't play
- Resolved
-
MC-93447 Music doesn't play!
- Resolved
-
MC-94102 Menu music not playing
- Resolved
-
MC-95373 Music won't play.
- Resolved
-
MC-95559 Missing soundtrack [minor bug]
- Resolved
-
MC-95751 No Background Music
- Resolved
-
MC-96029 Music not playing
- Resolved
-
MC-96469 Not hearing any music with music setting at 100% with sound on
- Resolved
-
MC-102492 No Ambient.cave sounds playing while inside both Single and Multiplayer/Realms worlds
- Resolved
-
MC-106446 Cave sounds do not work
- Resolved
-
MC-111236 no music plays when I play minecraft. Other sounds are ok but no music.
- Resolved
-
MC-112793 ambience
- Resolved
-
MC-116003 Cave sounds do not play sound but closed captions says it is
- Resolved
-
MC-116550 cave ambience is not playing
- Resolved
-
MC-118787 Eerie noise bug
- Resolved
-
MCL-4299 Music and Cave songs
- Resolved
- relates to
-
MC-91610 No Sound or Subtitles
- Resolved
-
MC-139255 Cave ambient sounds are not playing
- Resolved
-
MC-148360 Cave ambience sounds play no matter where you are
- Resolved
-
MC-171521 I hear overworld cave sounds in nether
- Resolved