Jump to content

[1.12][SOLVED] Json recipe with enchanted book ingredient


Ipsissimus418

Recommended Posts

I had upgraded my mod to use the json recipes as part of the 1.12.X port and I believe they were working find when I first tested them. I used to use a custom recipe handler in the pre-1.12 versions.

However I've recently retested due to a bug report (StoredEnchandments needing to use shorts in the nbt) and seem to be getting the same output item for all the recipes that have the all the same ingredients, apart from a different enchanted book.

These recipes all use vanilla enchanted books as an ingredient.

JEI shows the correct output for the input ingredients, but the vanilla crafting table gives the wrong output.

 

I've updated to using Forge 14.23.1.2554 with no difference.

 

eg. 

rate 1 upgrade (metadata 0) - factory base + t1 upgrade core + power I enchanted book -> output is decapitate I (metadata 12)

looting 1 upgrade (metadata 3) - factory base + t1 upgrade core + looting I enchanted book -> output is decapitate I (metadata 12)

 

https://github.com/Ipsis/Woot/tree/1_12/src/main/resources/assets/woot/recipes

https://github.com/Ipsis/Woot/blob/1_12/src/main/resources/assets/woot/recipes/upgrade_looting_i.json

https://github.com/Ipsis/Woot/blob/1_12/src/main/resources/assets/woot/recipes/upgrade_rate_i.json

https://github.com/Ipsis/Woot/blob/1_12/src/main/resources/assets/woot/recipes/upgrade_decapitate_i.json

 

 

All the recipes with enchanted books output the same item but with different metadata. 

 "result": {
    "item": "woot:upgrade",
    "data": 3
  },

 

 

This is the format of ingredient I was using successfully(?) before, probably during 1.12 development rather than 1.12.1 or 1.12.2.

    {
      "type": "minecraft:item_nbt",
      "item": "minecraft:enchanted_book",
      "nbt": {
        "StoredEnchantments": [
          {
            "id": 21,
            "lvl": 1
          }
        ]
      }
    }

 

I've also tried using the vanilla string nbt version of this with the same results.

     {
       "type": "minecraft:item_nbt",
       "item": "minecraft:enchanted_book",
      "nbt": "{ StoredEnchantments: [ { id: 32s, lvl: 1s } ] }"
     }

 

Edited by Ipsissimus418
Link to comment
Share on other sites

So I think I've solved this, because my upgrade to Forge 14.23.1.2554 didn't fully refresh the dev environment.

Now that I'm definitely running with the latest forge, it looks like my recipe issues are not happening anymore and I've getting unique items.

 

So I'll pass on my apologies for wasting peoples time.

(No matter how much you check, you always miss the obvious!)

 

 

Link to comment
Share on other sites

  • 3 years later...

Man you're a legend! 

I was searching the wide web on how to get enchanted books into crafting recipes in json format and stumbled upon your post. The format 

{
      "type": "minecraft:item_nbt",
      "item": "minecraft:enchanted_book",
      "nbt": {
        "StoredEnchantments": [
          {
            "id": minecraft:sharpness,
            "lvl": 1
          }
        ]
      }
    }

still works on 1.16.5 forge, so thanks alot!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.