Jump to content

[1.12.2] [SOLVED] Crafting recipe using only vanilla items can not be used


Recommended Posts

Posted (edited)

Hi. I have wanted to add crafting recipes to my blocks/items, but I ran into a problem. If the recipe contains my custom items as ingredients, it works exactly as it should, but when the recipe uses vanilla-only items, it cannot be crafted. The recipe still appears in the "Recipe Book", but no item appears in the output slot. My only idea is that it has something to do with the advancements system, but since nowhere is mentioned anything about that, I don't think that is the case. The game does not throw any error/warning messages to the log, so I am quite clueless. I am using Forge 1.12.2-14.23.3.2676.

 

This does work:

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "S"
  ],
  "key": {
    "S": {
      "item": "sevendaystomine:smallrock"
    }
  },
  "result": {
    "item": "sevendaystomine:woodplank"
  }
}

But this for some reason does not:

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "S"
  ],
  "key": {
    "S": {
      "item": "minecraft:stick"
    }
  },
  "result": {
    "item": "sevendaystomine:woodplank"
  }
}

 

EDIT: Updating to the recommended Forge 1.12.2-14.23.5.2768 did not help. I have also tried using generated recipes from https://crafting.thedestruc7i0n.ca/ and recipes from a various tutorial on the internet, but basically, as long as some of my items is not an ingredient, the recipe does not work.

 

EDIT 2: So I have found the origin of this all. It is because I have registered my custom IRecipe classes from code, which seems to be not needed. I have removed the code that does this and now it works!

Edited by Nuparu00
Solved
Posted

Your logs should be telling you the problem, please post them

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)

Posted

So I just redownloaded Forge MDK and created a new workspace and tried to make a recipe work in the example mod and it worked - after adding a .json file for a new advancement. But when I tried to replicate this in my actual workspace, it gave the same result as previous attempts. I have also tried using GameRegistry#addShapedRecipe() and RegistryEvent.Register<IRecipe>, but none of these worked at all. I do not know what to do now. I will wait and while and then I guess I have to either create my own recipe system, downgrade to 1.11.x or recreate my workspace.

Posted

Thank you, but there is not basically any place I could do this, as all logic of the registration should be handled by vanilla automatically unless I register it manually. When I tried to do so, I called GameRegistry#addShapedRecipe() from FMLInitializationEvent and I can confirm that it was called as the debug message has been printed + if I passed some non-sense (like a recipe with more than 9 items) actually threw an exception.
I think that the game is aware of the recipe, because the recipe shows in the recipe book, but for some reason the output slot is empty.

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.