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

Datapacks cannot replace vanilla crafting recipes.


    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 17w49a
    • Minecraft 17w48a
    • None
    • Community Consensus

      When attempting to replace vanilla recipes, by putting recipes in data/minecraft/recipes/..., it simply doesn't work, unlike loot tables, or advancements, which replace their counterparts when placed in that section. Instead, the recipe is marked as "A duplicate", and it crashes out your game when attempting to load the world with the pack installed.

      Encountered an unexpected exception
      java.lang.IllegalStateException: Duplicate recipe ignored with ID minecraft:sugar
      	at aoe.a(SourceFile:70)
      	at aoe.a(SourceFile:52)
      	at sd.c(SourceFile:132)
      	at sd.a(SourceFile:115)
      	at net.minecraft.server.MinecraftServer.a(SourceFile:1301)
      	at net.minecraft.server.MinecraftServer.a(SourceFile:330)
      	at ckz.a(SourceFile:81)
      	at ckz.d(SourceFile:128)
      	at net.minecraft.server.MinecraftServer.run(SourceFile:463)
      	at java.lang.Thread.run(Thread.java:745)

      However, when you add in the recipe when you're already in the game, it works fully.

      An example data pack is attached, which attempts to replace the sugar cane -> sugar recipe with a diamond -> sugar recipe. (dinnerboneNeedsToAddScoreboardRandomization.zip)

      If you load the data pack while already in the world, the recipe works, with an odd error. It'll work, but if you click the recipe in the recipe book, without the diamonds, it shows that you need sugar cane to craft it, while you just replaced the recipe with diamonds.

      If you add it in outside the world, the game will crash, but not close.

      Possible solutions:

      > Only mark recipes that are exact duplicates of the recipe as duplicates.
      > Don't trash duplicates, instead, only recognize them if they're in the same "group" as the original recipe, not unlike the iron nuggets -> ingot, and iron blocks -> ingot recipes.
      > Simply send an error, and don't load the recipe, instead of freeze-crashing the game.

            dinnerbone [Mojang] Nathan Adams
            CreeperMagnet_ CreeperMagnet_
            2 Vote for this issue
            3 Start watching this issue