Override ranged weapon hit sound

Started by Devilkin1987 on

Topic category: Advanced modding

Last seen on 02:15, 30. Mar 2019
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Override ranged weapon hit sound
Tue, 03/19/2019 - 03:15 (edited)

Does anyone know how to disable the hit sound when a ranged weapon bullet hits a block or entity? I have a mod that uses guns and I uploaded a sound for when the gun is fired. However, it makes an arrow hit sound whenever it hits an entity or block and sounds pretty lame.

 

Any help would be appreciated!

 

Edit: I found where all that information is located in the minecraft source files, but have no idea what the syntax would be to disable it.

Edited by Devilkin1987 on Tue, 03/19/2019 - 03:15
You don't need to search for…
Tue, 03/19/2019 - 11:59

You don't need to search for the code. You have CODE tab for this with a proper editor.

Last seen on 02:15, 30. Mar 2019
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found the source…
Tue, 03/19/2019 - 15:11

I found the source information in the CODE tab :). Just trying to figure out the syntax to disable the sound or redirect it to something really quiet. I found a video where someone changed the hit sound to be the shears which is nice and quiet. The guy didn't show how he did it though haha.

I have checked and playing…
Tue, 03/19/2019 - 16:24

I have checked and playing the arrow hit sound is part of the EntityArrow#onHit method. There is quite a lot of code to be changed to change this, unfortunately, and without some Java knowledge this won't be easy.

Last seen on 02:15, 30. Mar 2019
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, thanks for looking it up…
Tue, 03/19/2019 - 16:56

Ok, thanks for looking it up. If you have any suggestions of a good resource where I can get started on learning Java code for minecraft I'd love to learn. I have experience scripting in Linux so I have a slight background.

Mcreator is such an awesome program and I'd love to dive into minecraft modding a bit more. :)

In fact, to change this, you…
Tue, 03/19/2019 - 17:00

In fact, to change this, you only need to understand how Java works. The idea is to copy EntityArrow#onHit method in your EntityArrow class inside ranged item mod element code but without the line for the sound. Based on your experience you might be able to pull this off :)

Last seen on 02:15, 30. Mar 2019
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do I need to put this in as…
Wed, 03/20/2019 - 15:39

Do I need to put this in as a @Override? I've seen this in all the mod elements to change things from minecraft source code.