When listening closely to the music from a jukebox it becomes obvious that the music is not coming from the center of the block, but from the corner.
What I expected to happen:
I expected the music to come from the center of the jukebox, as all sides show a speaker-like texture (so the most logic place for the sound to come from is the center) and the slot where the music disc goes into the jukebox is also positioned in the center of the block.
What actually happened:
The music came out of the lower, north-west corner of the jukebox. This is barely/not hearable when at a range of more than two blocks away from the jukebox, but when listening closely with a stereo headset it becomes pretty obvious that the sound is not correctly positioned.
To reproduce:
The effect is best hearable through a stereo-supporting headset.
Place down a jukebox
Put a random music disc in the jukebox
Do a little dance unless you play 11 or 13 😛
Teleport on top of the jukebox, right in the center
Turn around while looking straight down and hear that the sound source position changes relative to you
❌ This should not happen when the music is supposed to come from the centerNow move to the corner at the north-west side of the jukebox
Turn around again and hear the sound not moving at all
❌ This means the sound source is positioned at the corner of the jukebox, and not in the center
Probable fix:
Looking at the code this Jukebox issue can be easily fixed. Decompiling the code (with Mojang mappings) I see this in LevelRenderer.playStreamingSound(...)
:
soundinstance = SimpleSoundInstance.forRecord(soundevent, blockpos.getX(), blockpos.getY(), blockpos.getZ());
While, to make the sound come from the correct position: the center, an offset of 0.5 should be added to each coordinate of the sound source:
soundinstance = SimpleSoundInstance.forRecord(soundevent, blockpos.getX() + 0.5f, blockpos.getY() + 0.5f, blockpos.getZ() + 0.5f);
Comments 3
MC-121364 is probably related but not duplicated - I'm talking about a wrong location of the sound source, which is actually an issue that can be fixed by Mojang.
See updated issue ticket for code analysis.
For the rest, the problems with directional sounds issued in MC-121364 do not apply to this issue.
(sorry if I didn't include code samples upon creation)
Thank you for your report!
We're actually already tracking this issue in MC-152752, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any additional information to the main ticket it would be appreciated.
Please be sure to use the search feature before creating a ticket to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 🛠 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 💬 Mojira Discord
Please read the moderator note on MC-121364.