Jump to content

Recommended Posts

Posted

Hello, I wanted to add a custom sound to my mod and it registers but it sounds different than the sound I want to use, here's my code:

 

SoundHandler

  Reveal hidden contents

Screen Shot 2017-06-05 at 9.26.31 PM.png

Posted (edited)
  On 6/6/2017 at 2:49 AM, DimensionsInTime said:
0.4F / (itemRand.nextFloat() * 0.4F + 0.8F

 

Why is your pitch that complicated formula and not 1.0F for normal speed?

Expand  

wow I feel so dumb now.. that fixed it! thank you.

 

Edit: is there anyway to make it sound as soon as I press the right click? it's working now but it has a tiny delay.

Edited by MinecraftWero
Posted (edited)
  On 6/6/2017 at 12:45 PM, diesieben07 said:

How did you get to that conclusion? You posted where you register your sound. Great. That tells us nothing about where and how you play it.

Expand  

 

I guess there was an issue with formatting in the main post..

anyways I  managed to fix it, here is my item class:

  Reveal hidden contents

 

Edited by MinecraftWero
Posted

Your play code was in there, it's how I knew you had that complicated pitch formula there. You just had a few nested spoiler tags that made it hidden. You have stream set in your json, so it should start playing right away instead of loading then playing.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.