Custom block sound pitch stays the same, no pitch range?

Started by Misfit on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom block sound pitch stays the same, no pitch range?

Today, I am having an issue with my Custom block sounds. I noticed that they have the same Pitch range when broke or walked on, same goes for placing. Vanilla Blocks have a pitch range that makes each sound differ from the next, like a blend each time the block is broken and placed so you're not hearing the same sound over again. I looked in the code of my custom block to see if there were anything/any part of the code to change the pitch range, but I can not find a valid way to repeat this pitch change hear with vanilla blocks.

The only string of code that looked like it handles the custom sounds was:
"super(properties.sound(new DeferredSoundType(1.0f, 1.0f, () -> ... etc"
and I thought that changing one or both of "1.0f" with a different range would give it variation, but it seems it does not work and just plays the same sound pitch without variation, only increased the pitch, but there were no variations 

Is there any way to replicate that vanilla sound pitch effect with blocks that have custom sounds without creating procedures, some bit of extra code I can add in to allow that range?