MedievalWeapons

MedievalWeapons

3M Downloads

Range Modifiers Do Not Work

catanobro10 opened this issue ยท 2 comments

commented

After doing some light testing, I noticed that all of the range modifiers for the weapons do not work as intended. However, I dug into the source code and figured out why and it's weird. As best as I can tell, the game does two checks to decide on the reach of an item: it first does a "before" check, then a "during" check for the attack. The "before" check is what tells the attack indicator to show that the creature is in range, and is necessary for the "during" check, which then makes sure the creature is in range before dealing damage. The code for the weapons is missing the "before" check, which uses the REACH modifier. So the two lines of code that increase/decrease the range of a weapon are:

`builder.put(ReachEntityAttributes.REACH, new EntityAttributeModifier("Attack range", 0.8D, EntityAttributeModifier.Operation.ADDITION));

builder.put(ReachEntityAttributes.ATTACK_RANGE, new EntityAttributeModifier("Attack range", 0.8D, EntityAttributeModifier.Operation.ADDITION));`

Hopefully that makes sense.

commented

Hopefully the development team sees this

commented

Thanks for reporting and giving the fix solution :)
Fixed with c511808