mojira.dev
MC-299683

music.creative (creative music) no longer plays in biomes with biome-specific music

Update: I’ve found the cause and proposed a fix in the comments.

The following change is not documented on any changelog and is therefore most likely unintentional:

Since 1.21.6, likely related to the music frequency changes, music.creative only plays in biomes that use music.game in survival, and doesn’t play in creative mode for the large list of biomes that have their own sound events (e.g., forests, deserts, caves, mountains, etc.). Previously, this event would take priority over biomes, giving the creative mode musical experience regardless of where the player was.

Steps to reproduce (most conveniently):

  1. Create a new single-biome soul sand valley world in creative mode

  2. Set music frequency to constant

  3. Listen to the song playing

  4. Repeatedly run the command /stopsound @s music and note the songs that play

Expected results:

  • Songs from the music.creative sound event will play, such as Biome Fest

  • No nether songs will play

Observed results:

  • Songs from the music.creative sound event will not play

  • Music is instead played from whatever biome you are in (such as Concrete Halls)

Biome suggestion and music frequency is for convenience of reproduction; the bug can be observed in every biome that doesn’t use music.game with results adjusted to be that biome’s specific sound event, as well as in every music frequency setting. Although actual soul sand valleys weren’t expected to play the creative soundtrack, it was the case for single-biome overworlds and the bug still holds for biomes such as the forest where it’s harder to notice the difference.

The expected results have been tested and are observed in 1.21.5 prior to the music frequency change. To confirm in 1.21.5, you can quit and rejoin the world repeatedly to test for more songs.

Environment

Windows 10 (Java)
No resource packs enabled

Linked issues

Comments 3

Another way to verify the bug is to add distinct subtitles to all the music sound events and notice that certain biomes don’t use the subtitle for music.creative as it is supposed to.

Also, Aria Math (one of the most iconic songs in the game) doesn’t naturally play in a lot of biomes

Cause and Fix

Alright, so this is because the old way of choosing creative music that didn’t look at the biome’s parameters https://mcsrc.dev/1/1.21.5/net/minecraft/client/Minecraft#L2477 was replaced by one that checks for it in the biome-dependent build https://mcsrc.dev/1/26.3-snapshot-8/net/minecraft/client/Minecraft#L2692 except none of the biomes actually defined the creative music so it falls back to survival.

To fix it, one can add the creative music back to every biome in OverworldBiomes.

One way is to change the single-parameter constructor for BackgroundMusic to have creative music. This requires the fewest line changes, and has some side effects, like adding creative music to the nether which was not the behaviour before 1.21.6

Another way is to add a two-parameter constructor, and use it for all the biomes. There are only 23 constructor calls in the overworld which can probably be replaced quickly with pasting or a regular expression.

You can also use the full three-parameter constructor, though that may be verbose.

Finally, you could create a method like BackgroundMusic.withUnderwater() to add creative music. Again, that’s currently 23 constructor calls to append .withCreative() to.

For example, after writing something relevant in BackgroundMusic, replace all (new BackgroundMusic\(.*)\)\)$ in OverworldBiomes with $1, SoundEvents.MUSIC_CREATIVE)) or $1).withCreative())

I still believe that the creative music needs to be able to play in these common biomes in creative. If biome-dependent songs are something you also want to keep, you could rework the creative sound event to also include those songs at the appropriately low weights.

blank3times

(Unassigned)

Confirmed

1.21.7, 1.21.8, 25w32a, 1.21.10, 25w45a, , 26.1.2, 26.2 Snapshot 4, 26.2, 26.3 Snapshot 7, 26.3 Snapshot 8

Retrieved