Regardless of values in the slots
field, when launching a melee attack, value effects of minecraft:damage
are always active if the enchanted item is in mainhand, and are always inactive if the item is in other slots.
The same thing happens to value effects of minecraft:armor_effectiveness
.
Steps to reproduce
Install the attached datapack
mc272006.zip
Enchant a sword with the command:
/enchant @s test:increase_damage_in_offhand
Hit some mob with the sword in mainhand
Hit some mob with the sword in offhand
Expected behavior
Mobs are one-hit killed when the sword is in offhand.
Observed behavior
Mobs are one-hit killed when the item is in mainhand.
The enchanted_hit
particles are also produced when hitting mobs with the item in mainhand.
How do I create this enchantment for step 1? Please provide any used commands in an updated description of the issue