Started by
Devilkin1987
on
Topic category: Advanced modding
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 the code. You have CODE tab for this with a proper editor.
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 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.
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 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 :)
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.
Yes, this is a method override.