mojira.dev
MC-271629

Channeling doesn't work / "post_attack" effect requires enchanted item to be in the mainhand

Channeling:

The enchantment Channeling doesn't work when the enchanted item isn't in the mainhand when the projectile hits anything, e.g. when you throw a trident in Survival/Adventure Mode.

 

Recreate:

  • Create new World

  • give yourself a Trident and enchant it with Channeling

  • set the weather to thunderstorm

  • throw the trident at a mob in Creative and the enchantment works as it should
    throw the trident at a mob in Survival and the enchantment doesn't work at all

 

 

Custom Enchantment:

Custom enchantments with the "post_attack" effect also don't work when the enchanted item isn't in the mainhand, even if the slot is set to "any". You can swap a (cross-)bow with a custom enchantment to the offhand or fire it from there and the enchantment wont activate when the projectile hits a mob. This also doesn't work if the enchanted item gets swapped into a non mainhand & offhand slot or thrown onto the ground before the projectile connects.
You can also use a trident as mentioned above and the enchantment won't work.

 

Recreate:

  • Create new World with the attached Data pack

  • give yourself a bow and enchant it like this: "enchant @s custom_enchantments_test:hit_detection"

  • hit a mob with the bow or shoot it and the enchantment works
    don't have the enchanted item in the mainhand when the shoot projectile hits a mob and it doesn't

 

Update:
included the right data pack version this time

Linked issues

Attachments

Comments 3

Is the trident's channeling enchantment not working caused by 'post_attack' not working? This issue currently seems to describe two seperate (but closely related) issues.

Yes, Channeling isn't working because "post_attack" isn't working correctly.

As it is a default enchantment, i thought i should mention it explicitly.

Thank you for clarifying. I can confirm.

Tyarda

Shugoh

Confirmed

Platform

Normal

Enchantments

24w18a, 24w19b

24w20a

Retrieved