Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7570

PrepareItemCraftEvent#isRepair() seems to always return false in 1.20

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Tested in spigot 1.19 and 1.20

       

    • CraftBukkit version 4014-Spigot-864e4ac-771182f (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT)
    • Yes

      PrepareItemCraftEvent#isRepair() seems to always return false on 1.20 versions of spigot, making it unreliable in checking if the current recipe is a repairing recipe. On 1.19 this seems to work properly

       

      The following code used:

      @EventHandler(priority = EventPriority.HIGHEST)public void onPrepareCraft(PrepareItemCraftEvent e){ System.out.println("is repair: " + e.isRepair());

      {color:#cc7832}}

      On 1.20 the following recipe

      returns

      On 1.19 this returns true instead.

       

      A workaround is checking if all items in the grid are identical, with max durabilities greater than 0.

            Unassigned Unassigned
            Athlaeos Athlaeos
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: