The Bug:
The slowness effect is applied to entities when the bane of arthropods enchantment is held in the off hand.
For example, when you melee attack a spider while having an item enchanted with bane of arthropods in your off hand, the slowness effect is applied to the entity you attacked. This doesn't make sense because the off hand item isn't being used.
Steps to Reproduce:
Hold a sword enchanted with bane of arthropods in your off hand by using the command provided below.
/item replace entity @s weapon.offhand with minecraft:netherite_sword[minecraft:enchantments={levels:{'minecraft:bane_of_arthropods':5}}]
Summon a spider and attack it using your main hand.
Observed Behavior:
The slowness effect is applied to entities when the bane of arthropods enchantment is held in the off hand.
Expected Behavior:
The slowness effect would only be applied to entities if the weapon used for the attack has the bane of arthropods enchantment.
Linked issues
is duplicated by 2
relates to 1
Attachments
Comments 6
A side effect of this is that it apples the enchantments for "main hand, off hand, head, chest, legs, feet, main hand". Notice how "main hand" is doubled up here...
Not 100% sure if this duplicates MC-3304. If not, then it definitely relates to it.
The same applies to Thorns. Holding an item with Thorns on it in any hand damages the attacker.
Same root cause, just a neighboring method (
Enchantment.onEntityDamaged()
vsEnchantment.onUserHurt()
).