mojira.dev
MC-304406

Enchantments on spears do not work if the spear is in the offhand

Spears can be held in the offhand to attack using charge attacks, but their enchantments fail to take effect when doing so. Instead, it uses the enchantments of the item held in the mainhand.

Steps to reproduce the issue:

  1. Spawn a mob.

  2. Use a charge attack on it using an enchanted spear in the offhand.

  3. Note how the enchantments do not take effect

Also note that the Knockback enchantment specifically would not work regardless, due to https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-310859.

Linked issues

Comments 5

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.

Can confirm in 26.1 snapshot 5

I would like to request ownership of this report as it fails to elaborate that this affects all enchantments, and it is not being actively updated with affected version numbers.

Futhermore, if a Fire Aspect weapon is held in the mainhand and a mob is killed with an unenchanted spear in the offhand, the mob will not catch fire but it will drop cooked food as though it had been killed with a Fire Aspect weapon. Meanwhile, a Fire Aspect spear in the offhand will ignite the mob but will not cook the drops.

This is probably related to MC-272006

Why are combat bugs always given such low priority, especially compared to other parts of the game? Does Mojang just not care about combat? There’s so many:https://docs.google.com/spreadsheets/d/1D1gAJB_PjQJHlar3ljo2qrNHllCcHglTpTolnkB1RZo/edit?gid=0#gid=0

SeaOfPixels

(Unassigned)

Confirmed

Platform

Low

Combat, Items

1.21.11 Pre-Release 1, 1.21.11 Pre-Release 3, 1.21.11, 26.3, 26.4 Snapshot 6, 26.4 Snapshot 10

Retrieved