Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-274503

Explosion caused by custom enchantments does not properly attribute the caused damage to the user of the enchanted item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21
    • None
    • Confirmed
    • Commands, Data Packs, Enchantments
    • Normal
    • Platform

      The explosion caused by the "explode" entity effect doesn't appear to correctly attribute the explosion to the player.

      This means that mobs killed by the explosion don't drop xp or loot that is specific to player kills (i.e. spider eyes).

      Steps to Reproduce:

      1. Add the attached data pack (mc-274503.zip) to your world to add the bugtest:explosive enchantment to bows. The definition for this enchantment is provided in explosive.json.
      2. Enchant a bow with the custom enchantment (using an enchanted book from the creative inventory)
      3. Fire the bow at a mob
      4. Have the explosion damage a hostile mob, iron golems, or the player

      Observed Results:

      Damage, and credit for any kills, from the explosion is attributed to the affected mob, so no XP is dropped. Passive Iron golems damaged by the explosion will attack the victim of the original attack, and not the player.

      Expected Results:

      The attribute_to_user field says that the explosion should be attributed to the user, in this case the player. Enemies damaged by the explosion should become hostile to the player, and XP should be dropped on kill.

        1. 2024-07-17 20-58-16.mkv
          6.01 MB
          cakeyeater99
        2. 2024-07-18_00.06.13.png
          133 kB
          cakeyeater99
        3. explosive.json
          2 kB
          cakeyeater99
        4. image-2024-07-19-18-15-02-679.png
          2.18 MB
          BugTracker

            Unassigned Unassigned
            cakeyeater99 cakeyeater99
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: