How would I get the game to realize that my custom DamageSource has its own hurt sounds? Such as when drowning, you hear drown hurt sounds rather than the generic hurt sounds.
You could perhaps subscribe to the PlaySoundAtEntityEvent event and change the sound. You would however need to figure out a way to detect when to change the sound in the event and when to leave it.
How would I get the game to realize that my custom DamageSource has its own hurt sounds? Such as when drowning, you hear drown hurt sounds rather than the generic hurt sounds.
A DamageSource has no sound associated with it at all. The player drowning sound is hard coded in the getHurtSound() in the PlayerEntity class.
Would it be possible to add a new SoundEvent using my custom DamageSource? I'm thinking I could use Reflection maybe? How would you go about it?
You could perhaps subscribe to the PlaySoundAtEntityEvent event and change the sound. You would however need to figure out a way to detect when to change the sound in the event and when to leave it.