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

Level cost in anvil depends on which item is the item to merge into; RepairCost value of sacrificed item ignored in level cost if primary item has a RepairCost



    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.16.1, 1.16.2 Pre-release 3, 1.16.2, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a, 21w18a, 21w19a, 21w20a, 1.17 Release Candidate 2, 1.17, 1.17.1, 1.18.1, 1.19.2, 1.19.3, 1.19.4
    • None
    • Confirmed
    • (Unassigned)


      The level cost in an anvil is affected by what order you put the items in. The sacrificed item's repair cost is basically ignored if the primary item has a repair cost, rather than added up to the total level cost. Everything (durability, enchantments, etc.) is merged into the main item, including the RepairCost (it'll be the sum+penalty); it's just not initially included in the level cost. There's literally no logic behind why one way is more expensive than the other, while the resulting item is the same.

      Clones MC-3880, but that was resolved as intended without Mojang source, this definitely seems like an oversight to me. I would request a reopen if the ticket wasn't ancient, so made this cloned report instead.
      The only "source" provided by the resolving mod was a wiki page, which is stated time and time again, the wiki is not a source for intended or unintended behavior.

      Easy steps to reproduce:

      1. Give yourself 2 diamond swords and an enchanted book with sharpness 5, one with fire aspect 2, and one with knockback 2
      2. Put 1 enchantment on 1 diamond sword, and the other 2 on the other sword.
      3. Put the swords in an avil, and look at the cost
      4. Switch around the swords, and notice a different cost, while the resulting item is the exact same.

      Additional, see that both combinations have the same RepairCost value:

      1. Duplicate the swords using the pick block key in creative, and make both combinations.
      2. Use the following command while holding the created sword
        /data get entity @s SelectedItem.tag.RepairCost
      3. Notice both swords have the same repair cost, despite the cost being different to create both swords.


        1. 2020-08-07_12.42.29.png
          529 kB
        2. 2020-08-07_12.42.31.png
          519 kB
        3. 2020-08-07_12.42.32.png
          526 kB
        4. 2020-08-07_12.42.34.png
          534 kB
        5. 2020-08-07_12.42.36.png
          525 kB
        6. 2020-08-07_12.42.37.png
          531 kB



            Unassigned Unassigned
            FVbico Dhranios
            7 Vote for this issue
            4 Start watching this issue