ZsoltMolnarrr / Archers

🏹 Draw, Release, Conquer - Master the art of Archery!
https://curseforge.com/minecraft/mc-mods/archers
Other
10 stars 5 forks source link

Two Handed bows do not prioritize offhand-held arrows (possibly due to Better Combat?) #6

Closed muon-rw closed 11 months ago

muon-rw commented 11 months ago

In vanilla, the ammunition held in your offhand is always used first. This is useful when holding multiple types of arrows to specify which you would like to use.

This mechanic does not work with longbows or heavy crossbows - it will eventually access your offhand arrows, but they are not used first.

Another problematic scenario which no longer works as expected: A heavy crossbow user holds explosive fireworks in their offhand, but keeps non explosive fireworks in their inventory for elytra flight.

I have not tested with Better Combat disabled.

Archers 1.0.3+1.20.1

ZsoltMolnarrr commented 11 months ago

This is likely a Better Combat issue, I will investigate.

ZsoltMolnarrr commented 11 months ago

Public note: entity.getStackInHand(Hand.OFF_HAND)) needs to be wrapped

   // RangedWeaponItem.java

    public static ItemStack getHeldProjectile(LivingEntity entity, Predicate<ItemStack> predicate) {
        if (predicate.test(entity.getStackInHand(Hand.OFF_HAND))) {
            return entity.getStackInHand(Hand.OFF_HAND);
        } else {
            return predicate.test(entity.getStackInHand(Hand.MAIN_HAND)) ? entity.getStackInHand(Hand.MAIN_HAND) : ItemStack.EMPTY;
        }
    }

To be fixed in Better Combat for sure.

ZsoltMolnarrr commented 11 months ago

Will be fixed by Better Combat 1.8.3.