RedditPP Mascot

RedditPP

r/technicalminecraft • … • u/Omegas_Bane

Minecraft 1.16.4 Bow mechanics- help needed

I'm currently looking into the code for bow mechanics. It's pretty complicated- and I'm not a coder, so I'm working at a disadvantage. If anyone can help explain how to either insert debug commands, explain how the minecraft code's distance and damage values work, or explain how arrows work- that'd be great.

What I have so far is from both functional testing, wiki reading, and code digging:

* Bows shoot arrows which are effected by the player/entity's speed. * Shooting any projectile is done with an inaccuracy value which modifies the starting vector of the arrow. * Charging the bow does nothing to modify the inaccuracy value. * Charging the bow works off of a set time which increments every tick. (Related to the number 72000 somehow?) * Arrows have a minimum damage. This is approximately 1 damage for unenchanted bows (related to minimum damage in the code of 2.0F?) * Arrows which stick into blocks and have a potion effect have a particle effect applied. * Arrows appear to have a terminal velocity lower than their starting velocity (tested with approx. 100 blocks height- damage was near minimal when firing when the top, despite it logically being effected by gravity and the damage increasing) * As far as the practical testing told me, Harming arrows ALWAYS deal their harming damage- they are not only applied if the damage does not exceed a certain amount. Will test further, and needs code looking.

What I need help with:

* Reading through the many classes which pertain to bows to learn more about what's going on in there. * Possibly adding a debug function to the chat so that I can easily see what's going on- a tutorial would help if it's not feasible to actually teach me. * Explanations of how the minecraft code translates XYZ values into block values.

I'll also be releasing a video on this in the future, and I will credit anyone who contributes in a description section- because any help is greatly appreciated.

Thanks.

— 0