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

Recipe.getResult().getType() yields incorrect material types in certain scenarios.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None
    • 2991-Spigot-018b9a0-f2f3094 (MC 1.16.5)
    • Yes

      While trying to create a plugin to prevent map duplication, I came across several weird instances of Recipe.getResult().getType() returning material types that do not reflect what the displayed material types in-game are in a crafting table. This affects unique recipes like the crafting recipes for tool repair, map enlargement, and map & book cloning.

      Tool repair & cloning recipes output Material.AIR instead of the actual material.

      Map enlargement outputs Material.MAP instead of Material.FILLED_MAP, when minecraft:filled_map is the result displayed in-game.

       

      Below is the simple debug code I was using for testing:

      @EventHandler
      public void onCraft(PrepareItemCraftEvent e) {
          if (e.getRecipe() != null) {
              Bukkit.broadcastMessage(e.getRecipe().getResult().getType().toString());
          }
      }

       

            Unassigned Unassigned
            Steven Steven Strickler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: