Charge attacks dealt with an offhand spear do not apply Sharpness, Smite, or Bane of Arthropods. Relates to MC-304406.
Like with MC-304406, holding a mainhand weapon that has Sharpness/Smite/Bane of Arthropods causes it to apply to the offhand spear’s charge attack.
Expected Result: Sharpness/Smite/Bane of Arthropods take effect when attacking with an offhand spear via charge attack, like it does for mainhand charge attacks
Observed Result: Sharpness/Smite/Bane of Arthropods do not take effect when attacking with an offhand spear via charge attack
The problem is deeply nested, but might not be fixed, at least not anytime soon.
net.minecraft.world.entity.player.Player::stabAttackuses thegetEnchantedDamagemethod fromServerPlayer(this could potentially be mangled due to my decompiler since it uses polymorphism) and it usesthis.getWeaponItem()which in turn uses the main hand.It’s related to MC-3304, and is likely a duplicate.