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
is duplicated by 9
relates to 3
Attachments
Comments 45
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.
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.
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:
Please provide me the resource pack you use.