Jump to content

Recommended Posts

Posted

I have created some crafting recipes for my Mod, but when I try to craft them ingame, the result doesn't show up. I also don't get the new recipe in the recipe book after obtaining all ingredients. I have tried to add a custom recipe using only minecraft items, and that didn't work either. 

They are in the following directory: "src/main/resources/assets/modname/recipes" my textures for this mod are in the folder "src/main/resources/assets/modname/textures" and show up ingame.

 

One of my .json files:

 

{
  "type": "crafting_shaped",
  "pattern": [
    "   ",
    " O ",
    "OOO"
  ],

  "key": {
    "O": {
      "item": "minecraft:obsidian"
    }
  },

  "result": {
    "item": "minecraft:diamond_block",
    "count": 1
  }
}

 

Do any of you have an idea why the recipes don't seem to work for me?

Posted (edited)

The recipe book is handled by an advancement, which is a separate JSON file.

Additionally if you have the gamerule enabled that any unlearned recipes are uncraftable, that could also be blocking you from crafting your new recipe until you have that advancement.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Thanks for the heads up I'll check out how minecraft handled advancements.

The Gamerule "doLimitedCrafting" is false and thus my crafting shouldn't be tied to advancements. I guess my file and path seem okay, in creative mode I can get my items without fail, so they are registered, and I read that the registering of recipes fires after items and blocks, so that shouldn't be the problem either.

Everywhere I go I see that Forge is handling the recipe registration by itself, my guess is that for some reason it can't find my path? I even updated my forge once and it still didn't work (from MC version 1.12 to 1.12.2).

Posted
16 minutes ago, EvilTwin said:

Everywhere I go I see that Forge is handling the recipe registration by itself, my guess is that for some reason it can't find my path? I even updated my forge once and it still didn't work (from MC version 1.12 to 1.12.2).

As long as the "modid" part of the path matches your mod ID (remember that everything is enforced lower case!) you should be fine.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Yep everything is correct, as my textures, models and everything else in my assets/modname folder makes it ingame. Is maybe rebuilding my project gonna help?

Posted

Not sure, I've not encountered this problem before.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Where would it be best to make a step in to check if it is the ResourceLocation that is the problem, sorry I don't know where exactly Forge is handling registration of recipes, is it in the same class as the registration of items, blocks etc?

Posted
5 minutes ago, EvilTwin said:

Where would it be best to make a step in to check if it is the ResourceLocation that is the problem, sorry I don't know where exactly Forge is handling registration of recipes, is it in the same class as the registration of items, blocks etc?

RegistryEvent.Register<IRecipe>

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

That is weird considering that I just created a json file in my recipes folder and then just dropped in your code and made the changes to the type

The code

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "   ",
    " O ",
    "OOO"
  ],

  "key": {
    "O": {
      "item": "minecraft:obsidian"
    }
  },

  "result": {
    "item": "minecraft:diamond_block",
    "count": 1
  }
}

 

Edited by CoderAtParadise
English

Did you really need to know?

Posted (edited)

It's working now, I've cleared my cache and rebuilt my Workspace and Project, now it works. Thanks to everyone for their heads up though :)

Edit: no not a single error, and they were in the .json format
Edit2: before that I also tried other stuff and before testing it in minecraft again, I also copied the Code, deleted the .json files and put it in new files in the exact same spot with another filename, maybe this could be it too, I don't know but it works for me now.

Edited by EvilTwin
Extra Info
  • Like 1
  • 1 year later...
Posted

Make your own thread with your code, your json and a detailed description of your problem

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • 1 year later...
Posted

I had this same problem and found the issue after hours of trying...

 

Of course I made sure to check the modid a thousand times, to see if they are spelled the same way, which they were. What I didn't pick up on, was that the recipe directory had a space next to the name, which I didn't see. This took me way too long to notice.

 

I hope this helps anybody.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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