Posted April 30, 20205 yr I have a class for an Item (in this case it extends ArmorItem) with some boolean values. I want to have a recipe that will switch these boolean values, and it depends on the actual Items in the recipe. The main Item is something like a piece of armor, the other is some item that will change the properties of the armor (through the use of the booleans) but keep everything else: durability, enchantments, ect. I am realizing the class will only be instantiated once for all ItemStacks of this Item, so I suppose I would need to store the information in the ItemStack NBT data or something, but I still need to do something when the crafting takes place. I'm fairly certain the json recipes won't do anything like this, so I need to have it in code. How can this be done? In the future, for Minecraft 1.16+, I would like to use the smithing table in sort of the same way where the item is upgraded but I don't want another Item, the Item will be the same because there will be many variations and they won't be that much different. Edited April 30, 20205 yr by Invilis
April 30, 20205 yr this should help: I will make fun of you if you are not able to look into the (vanilla-) code.
April 30, 20205 yr Author That's good, but not quite there yet. I need some way to tell what Item I am using in the recipe because it will have a specific effect. Using getContainerItem I can change the resulting Item but I need the change to depend on what the secondary Item was. The only thing I can think of is to make a custom crafting table block, that way I could have complete control over the ItemStacks involved, at least that's my theory. A game theory. Edited May 1, 20205 yr by Invilis
May 1, 20205 yr I believe you'll need to subclass net.minecraft.item.crafting.SpecialRecipe to create a special crafting recipe (look at ArmorDyeRecipe) Then you need to register a recipe serializer for said SpecialRecipe.
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.