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

Unavailable enchants are not greyed out when enchanting fishing rods, cost XP & Lapis when used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 13w47e, Minecraft 13w48a, Minecraft 13w48b, Minecraft 14w27b, Minecraft 14w33a, Minecraft 14w33b, Minecraft 14w34b, Minecraft 14w34c, Minecraft 1.8-pre1, Minecraft 1.8, Minecraft 1.8.6, Minecraft 15w31c, Minecraft 15w32c, Minecraft 15w40b, Minecraft 15w41b, Minecraft 15w44b, Minecraft 1.9, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.9.4, Minecraft 1.10, Minecraft 1.10.2, Minecraft 17w06a, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 1.13-pre2, Minecraft 1.13-pre6, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w47a, Minecraft 18w47b, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a, Minecraft 19w09a, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 5, Minecraft 1.14, Minecraft 1.14.1, Minecraft 1.14.2 Pre-Release 1, Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2, Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 1, Minecraft 1.14.4 Pre-Release 3, Minecraft 1.14.4 Pre-Release 4, Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4, 19w34a, 19w35a, 19w36a, 19w37a, 19w38b, 19w39a, 19w40a, 19w41a, 19w42a, 19w45b, 19w46b, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15 Pre-release 3, 1.15 Pre-release 4, 1.15 Pre-release 5, 1.15 Pre-release 6, 1.15 Pre-release 7, 1.15, 1.15.1, 1.15.1 Pre-release 1, 1.15.2 Pre-Release 1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w13a, 20w13b, 20w15a, 20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 7, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w46a, 20w48a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08a, 21w11a, 21w15a, 1.17 Pre-release 2, 1.17, 1.17.1, 21w39a, 1.18, 1.18.1, 1.18.2, 1.19 Pre-release 1, 1.19 Pre-release 2, 1.19 Pre-release 3, 1.19 Pre-release 4, 1.19 Pre-release 5, 1.19 Release Candidate 1, 1.19 Release Candidate 2, 1.19, 22w24a, 1.19.2, 1.19.4, 1.20.4
    • Confirmed
    • Items, UI
    • Normal
    • Platform

      This report only describes that an enchantment is shown which is not available. See MC-30730, which describes the general behavior that an enchantment table may provide less than three enchantments.


      The bug

      When enchanting fishing rods, you are not able to apply low level enchants; the bug here is that these enchants still appear as if they could be selected. They should be greyed out.

      See attached image: The first slot, which the mouse is hovering over, does not display any promised enchant in the tooltip and clicking it does nothing, yet it's not greyed out like the middle slot.

      Example

      Here is an example in video: Unavailable enchants are not greyed out (fishing rod).mp4

      Bug analysis

      SomeOtherSteve has done a detailed analysis of when the bug occurs and possible solutions in this comment.

      Code analysis

      The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

      The reason why this happens is because the enchantment level returned by the method net.minecraft.enchantment.EnchantmentHelper.calcItemStackEnchantability(Random, int, int, ItemStack) is used. This method always returns at least 1 for the first enchantment (0 meaning no enchantment available). I am not sure if this can be fixed in this method, however what can be done is having the method net.minecraft.inventory.ContainerEnchantment.onCraftMatrixChanged(IInventory) set 0 as enchantment level if no enchantments are available.
      This might not be the best solution and is only a suggestion.

        1. 2014-08-14_00.12.59.png
          2014-08-14_00.12.59.png
          76 kB
        2. 2018-07-22_14.31.53.png
          2018-07-22_14.31.53.png
          393 kB
        3. 2019-08-19_10.44.05.png
          2019-08-19_10.44.05.png
          222 kB
        4. image-2019-02-25-17-31-16-162.png
          image-2019-02-25-17-31-16-162.png
          258 kB
        5. Level 2 No Enchant.png
          Level 2 No Enchant.png
          206 kB
        6. Level 3 No Enchant.png
          Level 3 No Enchant.png
          203 kB
        7. Level 4 No Enchant.png
          Level 4 No Enchant.png
          200 kB
        8. Level 4 With Enchant.png
          Level 4 With Enchant.png
          202 kB
        9. Unavailable enchants are not greyed out (fishing rod).mp4
          3.15 MB

            Unassigned Unassigned
            redstonehelper [Mod] redstonehelper
            Votes:
            67 Vote for this issue
            Watchers:
            34 Start watching this issue

              Created:
              Updated:
              CHK: