mojira.dev
MC-91803

Cave / ambiance music can play far away from the player and is not audible

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.

Example fix (1.11)

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;
            }
        }
    }
}

Related issues

MC-4299 Unable to interact with any blocks while sneaking MC-92138 In-game music problem MC-92278 Music not playing MC-92353 No Music MC-92488 Title Screen Music Never Plays MC-92506 Music does not play MC-92816 sounds and music error. MC-92985 Music don't play on world and title. MC-93099 No music in game. MC-93168 Ambient cave sounds don't play MC-93447 Music doesn't play! MC-94102 Menu music not playing MC-95373 Music won't play. MC-95559 Missing soundtrack [minor bug] MC-95751 No Background Music MC-96029 Music not playing MC-96469 Not hearing any music with music setting at 100% with sound on MC-102492 No Ambient.cave sounds playing while inside both Single and Multiplayer/Realms worlds MC-106446 Cave sounds do not work MC-111236 no music plays when I play minecraft. Other sounds are ok but no music. MC-112793 ambience MC-116003 Cave sounds do not play sound but closed captions says it is MC-116550 cave ambience is not playing MC-118787 Eerie noise bug MCL-4299 Music and Cave songs

Comments

[Mod] Neko

Can confirm. Most likely due to sound rewrites.

migrated

Confirmed, but the commande /playsound music.game @a 1000 still works.

11people5

Using /playsound isn't really the same since you're basically manually telling the game to play the music instead of letting it happen naturally.

migrated

Can confirm, also this bug report is a duplicate of MC-91610.

kumasasa

@@unknown: MC-91610 is about not having any sound at all, this is only about having no automatic background music but rest of sounds.

migrated

To Kumasasa: The Author of MC-91610 updated his versions and status for effected versions to include the no music within the game or at the title screen. I myself tried playing the game today and noticed a lot of the sound issues have been addressed and I thank you guys for that.

migrated

Ditto, can confirmed, no music in overworld/end/nether.
What about the "Creative" music?
And music disks?

migrated

Yes, I noticed in at least the two latest snapshots 15w49 and 15w48 the music does not play on it's own, for the title screen at least. I haven't really confirmed that for in-game since I turned it off since I thought it wasn't working.

migrated

Confirmed for most minecraft 1.9 snapshots. I have played 15w40a-15w49b and have not heard background music. Have not tested in other snapshots. I can still hear all of the other sounds though.

migrated

If you want, type/copy following text.

/playsound music.creative @a ~ ~ ~ 10 1

It should play music.

11people5

We are already aware that using /playsound works โ€“ it has nothing to do with this bug though. This bug is about the music playing normally, meaning on its own.

migrated

Still no music in 15w50a

migrated

this bug is on Mac too. i really enjoy the minecraft music and hope this gets fixed real soon.

_zombiehunter

Still no music in 15w51a ๐Ÿ˜ž

migrated

No music in 15w51b, FeelsBadMan.

kumasasa

@all: This is not a discussion forum. If you don't have anything to contribute to the current bug like confirming if unconfirmed, work around or steps to reproduce - then simply don't do it.

migrated

16w02a: no title music, even after disabling and re-enabling music, then restarting. No sign of in-game music in any game mode or dimension. Credits music works.

[Mod]Les3awe

Confirmed for 16w02a.
Mod please reopened.

wobst.michael

Can confirm it's not fixed in 16w02a.

migrated

Same, not fixed in 16w02a.

migrated

It might have Something to do with sounds not being written to the correct areas, such as a witch still cackles when hostile mob sounds are off, and other things like that.(The last place I saw this was 15w51b though, so it might be fixed)

migrated

@@unknown: That is most likely not the issue, since it also occurs when all audio sliders are set to 100%.

wobst.michael

Still an issue in 16w03a. That one really should be fixed before the actual release.

migrated

Can confirm that it's still not fixed in 16w04a.

migrated

STILL not fixed in 16w05a

migrated

Confirmed, neither music nor cave sounds in 16w05a

migrated

Not fixed in 16w05b

Erik Broes

So, finally REALLY fixed.

migrated

Yes, really fixed! Thank you!

EDIT: well, the music is fixed, anyway. I have yet to hear any naturally-occurring cave sounds. Can anyone confirm that those work?

EarlyReflections

Not fixed. At first launch of 16w06a. I heard music play in title screen and was pleasantly surprised. But it didn't play at all in any of my worlds or on my server. Now it doesn't play anymore even in the title screen. I've toggled the music option on and off several times, but to no avail. No more music.

migrated

My music is working fine, but an hour of standing in an unlit cave system has not produced any cave sounds.

/playsound minecraft:ambient.cave ambient @p makes cave sounds, but they don't randomly play.

migrated

No cave sounds still, in 16w06a.

migrated

I've got music in 16w06a. It plays in both the menu and in game, in a world from a development snapshot that predates this bug if that makes any difference.

I was playing on 6 chunk render distance and having plenty of music. I switched to 10 chunks while in the Nether and as usual it slowed and got choppy for a few seconds, then started to come back to pace. Moments later it froze completely for several seconds--this is not normal but not unheard of in the Nether--but after coming back, the music disappeared and several minutes later there still had been no music, even after going back to the overworld and experiencing a sunset and sunrise. (They seem to trigger music sometimes.) I exited to the menu and went back in, and had music back again.

EarlyReflections

I spent more time looking into this one. At launch, the title music plays without issues. I don't have a clue as to why it didn't work at all at first. After joining a world, either local or remote, the music usually kicks in after a few seconds. Again I don't know why I had none earlier. After the first song finished playing, no more music. I continued playing for about 30 minutes without any music. When I left to the title screen, still no music. I relaunched the game and the music came back, both on the title screen and in game. But again, only for one song.

migrated

Sometimes the music goes silent but it shouldn't do that for more than about half a Minecraft day. Perhaps some chunk update or lag spike issue is causing this. Can you try playing in a lower render distance and see if the music remains, or if when it disappears it was during a lag spike?

EarlyReflections

Because of MC-94438, the lag spikes are pretty constant on my server. During daytime the server usually runs at around 16-18 TPS and during the night it runs at about 12-14 TPS. So daytime lasts around 11 to 13 minutes and nighttime lasts around 16 to 18 minutes.

I reduced my view distance to 6 chunks, stayed on for a full day cycle (+- 25 mins), and got the same result. No more music after first song is finished. The song does play completely though, nothing stops it. There's just nothing afterward.

Edit: Murphy's law; seconds after posting this, music kicked in! But that's still over 18 mins after 1st song finished.

wobst.michael

Music is playing fine for me, but cave/ambient sounds are not played as others have already mentioned. So can confirm the cave/ambient sound issue.

migrated

Music is now playing fine in 16w06a for me so I'm confirming it fixed, I noticed it's not in the changelog, just thought I'd mention it.

migrated

look in previous comments, the music is fixed, ambience (cave sounds) not

11people5

I think the bug name/description should be updated to more accurately fit the bug now. It should be something like "In-game cave ambiance does not play automatically".

migrated

Still not hearing cave sounds in 1.9 Pre-2

11people5

I was just editing the recording I made last night of my friend and I playing survival, and randomly (about 2 hours in) I heard cave ambiance play. Didn't notice it before now.

kumasasa

Then we can consider this as fixed ?

migrated

I spent an hour in an unlit cave system and did not hear a single cave sound. All volume settings turned up, all other sounds are working great. I heard lots of music, bats, lava, water, nothing else.

11people5

Try spending 2 hours in or near an unlit cave system, as we were on the surface when it played. We played for 4 hours, yet it only happened that one time, so maybe it's just extremely uncommon?

_zombiehunter

Haven't heard any ambient sounds in 1.9 pre-release 3 so far ... running around in full sunlight near completely dark rooms and cave systems, I can hear zombies, skeletons, witches, bats but no cave ambience

migrated

Spent some time in caves, didn't hear anything!

migrated

1.9-pre4, /playsound minecraft:ambient.cave ambient @p works fine, but I'm still not hearing anything while hanging out in dark caves.

migrated

reopened as of @unknown comment

11people5

Grum has a really bad habit of marking bugs as resolved before he has actually done anything about it. He really needs to stop doing that. Marking a bug as fixed for a later update is just an easy way to forget about it.

_zombiehunter

Playing MC survival (1.9 pre 4) for an hour now, found a village right after spawning, removed all torches, sealed off all windows and doors to make them completely dark inside ... all houses are filled with zombies, skeletons and spiders by now, there are also dark caves directly underneath the village, but haven't heard a single cave sound so far ๐Ÿ˜ž

@Krev Hard to say if he actually has done anything about it, maybe he just forgot to push his commits, maybe he didn't test it, maybe it broke again because of something else, dunno ... I just think after 3 attempts and 3 days before a major release, something like this should be fixed.

migrated

The official Mojang blog had "Fixed an issue that can affect sound positions" listed for 1.9-pre4, so I'm thinking someone went "well, that should fix it", and marked it as fixed again without actually verifying the fix.

migrated

It is fixed in 1.9 release, I know because the ambiance scared me, the thing is it only triggered when I got hit by a zombie.

migrated

Still haven't heard it once since the release of 1.9.

Interesting enough, if you turn subtitles on, you will occasionally see "Erie noise" but nothing is actually heard. I could assume these are meant to be the cave sounds.

_zombiehunter

Haven't heard any cave ambience in 1.9.1-pre1 so far ...

migrated

No ambience in caves for 1.9.2 so far

_zombiehunter

No cave ambience in 16w15a either ... the sounds even show up in the subtitles as "Erie noise" from time to time as Sebastiano La Gala mentioned, but the sound itself doesn't play at all.

11people5

Every so often when I load a chunk with a minecart in it, the subtitles will say "Minecart rolls" dispite being more than out of range of the sound. So the fact that it's also saying "Eerie noise" without playing the cave ambiance could mean that it's playing the sound in a random location for some reason, and it's (more likely than not) out of range of the player.

_zombiehunter

@Krev They're definitely not out of range all the time, especially when walking around directly next to dark rooms and above dark caves, those characteristic sounds are hard to miss when they play and I've used them quite a lot to track down dark areas in previous MC versions. Haven't heard them in any of the 1.9 snapshots and released 1.9.x versions so far.

11people5

It would seem that what I said IS the case, as I decided to test it. The test came out positive.

Here's a short video of the test & its setup: https://youtu.be/TzzswTJnHyo
I also tested this in a default world beforehand, and it would occasionally display "Eerie noise" in the subtitles, but I could never make it to the location before the sound stopped. In the video, I fixed this by making a smaller, more controlled environment to test with. It worked oddly well.

I'm gonna test some more to try and see how consistent it is, even though I'm now willing to bet it's 100% consistent.

Asteraoth

Confirm for 1.9.3 pre-2

migrated

No in-game cave sounds in 1.9.4

migrated

Agreed. I ran around for 10+ minutes in a dark cave and there was absolutely no ambiance that played when I did not enter in the /playsound command to the chat bar.

migrated

they should change the name from "In-game cave ambiance does not play automatically / very rare" to "In-game cave ambiance plays away from the player"

migrated

because the video that Krev made explains it.

migrated

Very true, but it looks like everyone (or most) on this thread seem to be having the same issue, where none at all plays automatically even though the slider is up and the subtitles are on. ๐Ÿ˜›

migrated

the same happened to the level up sound but that was fixed

migrated

so it is playing but its not playing directly at the player

migrated

proof is on krevs video

migrated

still in 1.10 pre 1 ๐Ÿ˜ž

migrated

STILL IN PRE 2 ๐Ÿ˜ž

migrated

I herd people were talking about new cave sounds were added but not exactly sure if they were because the bug is still here ๐Ÿ˜ž

migrated

Used playsound command just now and there are new cave ambience so this bug might get fixed soon i hope

migrated

Shows that the words are dark grey and usually in subtitles the words would be white some times u would see the arrow pointing right or left

migrated

in the screenshot it shows the problem

migrated

Can confirm for all 1.10 pre releases.
I have spent over an hour in the same cave and heard nothing, however the subtitles will mention the ambience sounds being played.

Sums up the last 7 comments in 2 sentences...

_zombiehunter

So they added 2 new ambient sounds in the last pre-release but we canโ€™t hear them because they didnโ€™t fix this bug?

migrated

Still in 1.10

migrated

Actually, you can use /playsound to get it to play (it worked before, the sound is ambient.cave). It picks one of the sixteen randomly, so I'm not sure if it will work or not. I got annoyed by them playing too much (which wasn't a bug, it was that my base is a giant cave), so when I got 1.8 I disabled them, and re-enabled them in a 1.9 snapshot but haven't heard any. I have upgraded to 1.10; to play the new sounds, use the command*:
/playsound minecraft:ambient.cave master @p

Spoiler alert!!: Here is what the new sounds sound like, (I can tell the old from the new because I always live underground because... you get the point):
1. Sounds like breathing
2. Sounds like breathing and tapping
3. Sounds like a discordant warp of a bird, a computer fan, and other various, creepy sounds.

*(I have no idea why, but I started writing equation instead of command ;D)

migrated

This bug is still in 1.10 hoping this bug gets fixed in 1.11 or else it will be a bit less interesting to find caves. ๐Ÿ˜ž

migrated

I mean they tryed to fix it in 1.9 pre 4 and added new cave ambience why not fix it?

11people5

Sam, this has nothing to do with the playsound command. It only has to do with cave ambiance playing naturally.

migrated

@@unknown: Please stop constantly editing your posts. 58 people are receiving an email each time you do. The preview feature exists for a reason.

migrated

I ask y'all to stop posting garbage here. I subscribed this ticket to be informed when the bug gets fixed, not to see kiddies whining again and again with every new version.

migrated

@9000awesomeness that has already said (by yours truely) about a month ago. Please stop commenting stuff that's already been said. I am watching this for information, not users repeating what others have commented

11people5

Confirmed for 16w41a
Cave ambiance still plays randomly away from player.

11people5

Confirmed for 1.11-pre1

migrated

Please post new comments in the future when confirming for newer versions, edits don't show up in the activityfeed.

migrated

The bug still in 1.11 version i miss the cave sounds :/

migrated

I can confirm that this bug STILL exists in 1.11 - no ambient cave sounds play at all .... despite subtitles indicating that they should be playing.

migrated

It's already marked as affected.

LuxiKeks

Interestingly, this bug was fixed in OptiFine 1.11_HD_U_B3

See here: http://optifine.net/changelog?f=OptiFine_1.11_HD_U_B3.jar

11people5

Confirmed for 17w06a

Sonicwave

Confirmed for 17w13b, saw a subtitle with no sound accompanying it.

11people5

Confirmed for 17w14a.

Not sure why the bug summary/description still mention game music. The bug should be renamed to simply, "Cave Ambiance plays too far away from player"

11people5

Confirmed for 17w15a.

Also, thanks to whoever updated the summary/description.

11people5

Confirmed for 17w16a.

11people5

Confirmed for 17w16b.

11people5

Confirmed for 17w17a.

_zombiehunter

Still not fixed in 1.12-pre3 !!!
Another update to be released and this issue remains. How come that such an important feature is even kept broken before realising an update in the first place, let alone 3 more updates afterwards? Those ambient sounds exist since Minecraft alpha and are as characteristic for this game as creepers. Before 1.9, Iโ€™ve been regularly using ambience sounds in survival to detect dark caves or holes around my bases, and now โ€ฆ you know how often I heard them after the 1.9 update in a standard survival world? One time โ€ฆ one single time โ€“ and only because I was by chance sprinting towards the sound while running from a few mobs.
Thereโ€™s even a possible fix pointed out in this bug report. Is there any technical reason why this canโ€™t be fixed over such a long period of time (nearly two years now I think?) or is every snapshot and update developed and tested with all sounds turned off before releasing them? The fact that MC-35856 still isnโ€™t fixed either would suggest latter case. I mean, itโ€™s pretty obvious those eery cave sounds are missing when walking around dark places or having overlapping music play when you load a different world. One would really think that the developers of the most successful game ever would at least fix such obvious bugs in a reasonable timeframe ... espcecially when there's apparently enough dev time for adding llamas or parrots. Not cool, Mojang, really not cool ๐Ÿ‘Ž

migrated

I haven't heard a cave sound since this bug first came out in 1.9 development snapshots. What's the point of adding more cave sounds if they can't be heard? Talk about sorting your priorities.

I put in several hours of gameplay with the subtitles turned on. I've seen a bunch of cave sounds play in the subtitles along with the very strange "minecart rolls" showing up repeatedly pretty much anywhere in the world, in places where there's no minecarts around. I still haven't heard any cave sounds, and I also can't hear any sound playing for "minecart rolls". I used spectator mode to try and discover the location of the alleged minecart, but found nothing.

wobst.michael

Appears to be fixed in 1.12.2 pre-1.

_zombiehunter

Can confirm, it's fixed. Just did a test run and heard more ambient sounds from caves by playing for 30 min in a random world than over the last 2 years. I wish I could say "thanks Mojang for fixing this", but I made my point pretty clear in my last comment. Some things just shouldn't take that long or at least be communicated why they do so. Just glad it works now :-|

migrated

Confirm, but its working only in survival without night vision and happens pretty rare, also in minecraft 1.2.1 (ios), its still missed

wobst.michael

Someone in MC-139255 reported that this is an issue in 18w45a again. Can anyone confirm this?

_zombiehunter

Made a quick test world with two meters of dark space beneath a flat layer of stone, perfect to provoce cave ambient sounds. Tested it in 1.13.2, heard the first one after 10 min. Then tested it in 18w45a, none after 30 min. They might really be broken again.

11people5

I did my test again, and it turns out that cave ambiance just doesn't play at all in 18w46a. Probably has to do with the new light engine changes, but that's just a guess.

11people5

I'd like to point out that this is technically no longer the same bug due to cave ambiance not playing at all (where before it only played away from the player).

[Mod]Les3awe

Erik Broes

Confirmed

ambient, ambient-sound, cave, music, player, position

Minecraft 15w44b, Minecraft 15w45a, Minecraft 15w46a, Minecraft 15w47a, Minecraft 15w47b, ..., Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 18w46a

Minecraft 16w02a, Minecraft 16w06a, Minecraft 1.9 Pre-Release 4, Minecraft 1.12.2 Pre-Release 1

Retrieved