mojira.dev
MC-260346

Custom music discs cut off when vanilla disc would normally end

Custom music discs cut off in the same time when the vanilla disc would end. This bug shows up in snapshot 23w07a and affects any release/snapshot after it. I attached a video showing a copyright free song getting cut off in minute 1:11, the length of disc 11.

Code Analysis:

Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 45

Please provide me the resource pack you use.

Can confirm in 23w07a. This is being caused by a recent change to jukebox mechanics, which automatically cuts off the disc track when the jukebox's TickCount value reaches its RecordStartTick + the length of the track and the IsPlaying value is set to 0. I've attached a resource pack that replaces the music disc "5" (a 71-second track) with the game's end credits song "alpha" (well over 10 minutes), which cuts out mid-note at the 1:11 mark. This behavior does not extend to playing the sound event with /playsound.

Given that resource packs have been able to overwrite music discs for nearly 10 years now, it may be worth re-evaluating how that system works.

Can confirm. And this completely clones MCPE-162976. The reason for both is because the time of the record item is hardcoded without considering the resource pack.

Do note that the jukebox behavior is a sever side behavior, and a resource pack shouldn't be considered in changing the time value. The best way to resolve this is rolling back the change, or allow players to specify how long to play the music for.

Confirmed in 1.19.4 pre-release 2.

My first instinct, short of rolling back the changes entirely, would just be to keep the sound playing after {{IsPlaying }}ticks to 0, unless the disc is physically ejected. It would still automatically eject the disc into a hopper after the normal runtime, but that's not hard to work around with redstone if you still want custom music discs and jukebox automation.

35 more comments

Just noticed this issue in 1.21.10. If music disc tracks are supposed to be modifiable by resource packs just like all the other in-game music, they should at least play properly and not just cut off.

If this was resolved it’s broken again because its now working in v26.2

The issue is indeed still present as of 26.2 and 26.3 Snapshot 5, the soundtrack used is 3 minutes long and appears to get cut off at the 1:12 span.

26.2:

23w03a (and prior versions):


Resource pack:

[media]

@BugTracker - BugTX The track length needs to be specified in a data pack.

That makes sense. I'd tested it without the length set in a data pack, that seems to be the intended fix.

migrated

kingbdogz

Community Consensus

Platform

Normal

Resource Packs, Sound

jukebox, music_disc

23w07a, 1.19.4 Pre-release 1, 1.19.4 Pre-release 2, 1.19.4 Pre-release 3, 1.19.4 Release Candidate 2, , 1.20.1, 1.20.2 Pre-release 1, 1.20.2, 1.20.4, 1.20.6

24w21a

Retrieved