Additional Notes for this (1.21.11): Using an unenchanted spear in your offhand with a Knockback II sword in your main hand causes the charge attack of the spear to gain the Knockback II effect. Sharpness is also affected, both in terms of particles and mechanics.
If you spawn a cow and observe how many charge hits it takes to kill, how far it is knocked back, and whether or not the sharpness particles appear using a spear’s charge (at a regular sprint) with the following setups, you get the following results:
Unenchanted Netherite Spear (On-hand): 2 attacks, regular knockback, no particles
Sharpness V & Knockback II Netherite Spear (On-hand): 1 attack, far knockback, sharpness particles
Unenchanted Netherite Spear (Off-hand): 2 attacks, regular knockback, no particles
Sharpness V & Knockback II Netherite Spear (Off-hand): 2 attacks, regular knockback, no particles(Unexpected)
Unenchanted Netherite Spear (Off-hand) with Sharpness V & Knockback II Wooden Sword (On-hand): 1 attack, far knockback, sharpness particles(Unexpected)
Sharpness V Netherite Spear (Off-hand) with Sharpness V & Knockback II Wooden Sword (On-hand): 1 attack, far knockback, sharpness particles
Smite and Bane of Arthropods appear to have the same issue. Looting is also unavailable if the spear is in the offhand and is transferred over if it appears on an item in the on-hand, although I am unsure if this is intentional.
Conversely, Fire Aspect works as-expected, applying fire if the offhand spear is enchanted with Fire Aspect, but not if the offhand spear is unenchanted with a Fire Aspect weapon in the on-hand.
Additional Notes for this (1.21.11):
Using an unenchanted spear in your offhand with a Knockback II sword in your main hand causes the charge attack of the spear to gain the Knockback II effect. Sharpness is also affected, both in terms of particles and mechanics.
If you spawn a cow and observe how many charge hits it takes to kill, how far it is knocked back, and whether or not the sharpness particles appear using a spear’s charge (at a regular sprint) with the following setups, you get the following results:
Unenchanted Netherite Spear (On-hand): 2 attacks, regular knockback, no particles
Sharpness V & Knockback II Netherite Spear (On-hand): 1 attack, far knockback, sharpness particles
Unenchanted Netherite Spear (Off-hand): 2 attacks, regular knockback, no particles
Sharpness V & Knockback II Netherite Spear (Off-hand): 2 attacks, regular knockback, no particles (Unexpected)
Unenchanted Netherite Spear (Off-hand) with Sharpness V & Knockback II Wooden Sword (On-hand): 1 attack, far knockback, sharpness particles (Unexpected)
Sharpness V Netherite Spear (Off-hand) with Sharpness V & Knockback II Wooden Sword (On-hand): 1 attack, far knockback, sharpness particles
Smite and Bane of Arthropods appear to have the same issue. Looting is also unavailable if the spear is in the offhand and is transferred over if it appears on an item in the on-hand, although I am unsure if this is intentional.
Conversely, Fire Aspect works as-expected, applying fire if the offhand spear is enchanted with Fire Aspect, but not if the offhand spear is unenchanted with a Fire Aspect weapon in the on-hand.