Topic category: Help with modding (Java Edition)
So I have made this weapon called "The Focus Dopamine". The basic usage is: When you right click while you are looking at a mob at most 10 blocks away, it plays a ding noise that goes up it pitch the longer you hold it on the mob. The amount of time held on a mob also determines how much damage is done and the size of the effect (from a small pop to a big explosion with particles) when you look away from the mob or let go of right click.
I have tried many different things with raytracing but I haven't gotten anything to work the way I want, The procedure I think should work is: If the player is looking at a mob - while right click is being held with the item in main hand, a "damage number" goes up and caps at 200, It should also be playing a dinging noise (which if anyone knows how to make it get higher and higher pitched please tell).
When right click has stopped being pressed or sight of the mob breaks, it should take the final damage number and do the according things
if dmg # <= 10 --- 1 dmg is dealt, small hit noise is made with no particles.
if dmg # >= 50 --- 3 dmg is dealt, slightly louder hit noise with small particles.
if dmg # >= 100 --- 7 dmg is dealt, medium hit noise with particles.
if dmg # >= 150 --- 15 dmg is dealt, loud hit noise with intense particles.
if dmg # >= 200 --- 24 dmg is dealt, max hit noise with spectacular particles
of course these values can change but I just don't know how to get this to work. if anyone can help me out with any raytracing ideas and/or the damage number stuff it would be so helpful