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

Advancement trigger item_durability_changed doesn't trigger with mending

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.12.2, Minecraft 18w11a, Minecraft 18w19b, Minecraft 1.13.2, Minecraft 18w50a, 1.15.2, 20w08a, 20w22a, 1.17.1, 21w37a, 1.18.1, 1.19.2, 1.19.3, 1.19.4, 1.20.1, 1.20.2, 23w43b
    • Confirmed
    • Advancements

      The Bug

      The minecraft:item_durability_changed advancement trigger doesn't trigger when the mending enchantment repairs items.

      Steps to Reproduce:

      • Download the attached data pack. mc-127340.zip
      • Create a new world using this data pack.
      • Once you've entered the world, reload all data packs.
      • /reload
      • Give yourself a wooden shovel enchanted with mending that is slightly damaged.
      • /give @s minecraft:wooden_shovel{Damage:30,Enchantments:[{id:"mending",lvl:1}]}
      • Switch into survival mode and use the shovel.
      • → Notice how the scoreboard increases, therefore indicating that the minecraft:item_durability_changed advancement trigger was triggered.
      • Make sure you're holding the shovel and summon an experience orb at your position so that the mending enchantment repairs it.
      • /summon minecraft:experience_orb ~ ~ ~ {Value:1}
      • → Notice how the scoreboard doesn't increase, therefore indicating that the minecraft:item_durability_changed advancement trigger doesn't trigger when the mending enchantment repairs items.

      Expected Behavior

      The expected behavior would be that the minecraft:item_durability_changed advancement trigger would trigger when the mending enchantment repairs items.

      Code analysis and fix

      Code analysis and fix by Avoma can be found in this comment.

        1. mending.json
          0.6 kB
        2. mc-127340.zip
          1 kB
        3. MC-127340.mp4
          6.94 MB

            Unassigned Unassigned
            jirauser71590 user-f2760 (Inactive)
            Votes:
            9 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: