• Hello Guest! Did you know that ProjectKorra has an official Discord server? A lot of discussion about the official server, development process, and community discussion happens over there. Feel free to join now by clicking the link below.

    Join the Discord Server

Sound Variables

xNuminousx

Verified Member
Okay so I'm not at my personal computer so I can't remember EXACTLY what the code looks like but it should be pretty easy to answer.

So while I was adding sounds to CosmicBlast, I noticed there were two numerical variable at the end of the .playSound that I didn't know what it was.

I'm pretty sure I used getWorld().playSound(location, sound, numerical value, numerical value); for the sounds. Anyone got any idea what those last to variables are? I tried changing them to see any difference but I didn't notice anything. Maybe I wasn't changing them by enough. Something I figured is one of the variables could be the range in which it's heard, which would explain why I couldn't hear a difference. Another could be volume I guess. I'm just not sure.

Thanks for le help :)
 

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
The last two values are volume and pitch. Both of which need to be a float between 0 and 2, and the normal sound you hear for everything has these values at 1.0 (apart from a few like baby zombies, which have normal zombie sounds but with a higher pitch).

Although I'm not an expert, I believe that although raising volume above 2.0 won't make it any louder (you can use loops to play it multiple times instead), raising it above 2.0 expands the range it can be heard by players. Not really anything useful to know since the range can't really be controlled easily, but a fun fact to know lol
 

xNuminousx

Verified Member
And they happen in that order? First is Volume and second is pitch?


Sent from my iPhone using Tapatalk
 

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
I believe so, but don't quote me on that.

The easiest way to tell is to set one to 1.0 and one to 0.1. If the pitch is 0.1, it's very very slow and low in pitch (obviously). For volume it's just mega quiet.
 
Top