In Minecraft Java Edition, the note color is graded. However, in Bedrock Edition, the note color changes are not continuous.
Since the particles in Bedrock Edition are data-driven, I downloaded the official original resource pack for details. I didn't find any problems in Json, so I think the problem is with the molang passing in parameters. (I think there may be negative value)
I made a resource pack for testing and copied the note particle files from the official vanilla resource pack into the pack, using “Math.max()” in the color parameter to limit the numeric size to 0 or more. After the resource pack is imported into the game and loaded, the color of the note particles becomes continuous. This proves my conjecture.
However, the RGB color value should not contain a negative number, and I have doubts about how this value is calculated. So I modified the particle profile again and drew a special texture that showed the molang color values as a texture. In this way, I was able to get accurate (perhaps) color values. By looked at the value, I think that this value is calculated by the sin function.
The reason for the problem is that the sin function has a negative output, but the game doesn't handle it (set to 0). Because of the wrong value passed in, the color of the particles is not as expected.
Fix:
Convert negative values to 0 by adding “Math.max()” to the data-driven file of the note particles, with the first value being the molang of the incoming color and the second value being 0.
You may be asking why not just set the negative value of these molangs to 0? This is because some packages rely on these problematic negative values for special functions (such as displaying the pitch of note blocks), and truncating the negative values directly may cause these packs to not work.
This issue was also reported by MCPE-15116, but it was incorrectly marked as fixed (in fact, from version 0.15 to the present version, this issue is still not fixed). In addition, I provided more detailed reasons for the error and solutions, so I chose to re-report.
Attachments
Comments 2
