-
Bug
-
Resolution: Unresolved
-
None
-
1.21, 1.21.1, 24w34a
-
None
-
Confirmed
-
Data Packs, Enchantments
-
Normal
-
Platform
In a custom enchantment, when using the post_attack enchantment component for the attacking entity, the effect does not apply unless the attacking entity uses the enchanted item to attack.
Steps to reproduce
- Download the attached datapack SayMyName_datapack.zip
and apply it to the world
- Enchant a helmet with /enchant @s saymyname:say_my_name
- Hit any mob using the enchanted helmet
→ A message by the attacked entity will appear in chat - Place the helmet in your head slot and hit any entity using an item that is not enchanted with this enchantment
Expected results
Because the enchanted helmet is equipped, it should still apply the enchantment and a message should show up, since the enchantment is defined for both mainhand and head slots.
Observed results
When the helmet is in the head slot, there is no message in chat.
Note
The enchantment works if the post_attack effect is executed by the victim:
"enchanted": "victim", "affected": "attacker"
(i.e. what the Thorns enchantment does). However, this means the message is from the attacked entity, not the attacker.
- is duplicated by
-
MC-276024 "minecraft:post_attack" effect doesn't function properly when applied to any slot other than mainhand
- Resolved