Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically modify recipes? #9

Open
Chekote opened this issue Feb 26, 2018 · 1 comment
Open

Programmatically modify recipes? #9

Chekote opened this issue Feb 26, 2018 · 1 comment
Labels

Comments

@Chekote
Copy link

Chekote commented Feb 26, 2018

Thanks so much for the guide, it's really well documented! I do have a quick question I hope you can assist with:

I want to have config options in my mod that affect recipes. For example, change a particular recipe ingredient from Emerald to Diamond. I'm currently trying to implement this by modifying the recipe programmatically when the mod loads. This is easy to do in earlier versions that don't use the JSON files, but I can't work out how to do it when using JSON files.

Is there a way to programmatically modify these recipes?

Thanks in advance for your help!

@skylinerw
Copy link
Owner

Unfortunately I'm not a modder so I don't have any experience in that area. One issue is that fully data-driven recipes are only available in 1.13+, but 1.13 is still in snapshot stages so there's no deobfuscated MCP variant for it.

Looking at the CraftingManager for 1.12 MCP, it looks as though you cannot just overwrite one of the recipes in its entirety. You might be able to get a recipe from its resource location from the crafting manager, and then get the ingredients from the resulting IRecipe. I'm also not too familiar with Java, so when I say that you might be able to edit the ItemStack you get from that and it'll work, it might not work. Plus I'm not sure how/if a 1.12 server will notify the client of changes that deviate from vanilla.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants