Foxhostyle Posted March 19, 2020 Report Share Posted March 19, 2020 Hello everybody I want to create a new item "kunai " but i don't know how it works to create a knapping recipe. I have already created the following pattern : "____##____", "___####___", "__######__", "_########_", "__######__", "___####___", "____##____", "____##____", "___####___", "____##____" in the file : recipes/knapping/kunai.json Can someone help me ? Link to comment Share on other sites More sharing options...
copygirl Posted March 22, 2020 Report Share Posted March 22, 2020 What's the issue at hand, here? Would you create a custom mod and don't know how that works, have you already created a kunai item, is something unclear about the recipe .json, or did you do that all and there's an error when you try to load the game? Also, please post your full "kunai.json" file. (In general, I can only recommend referring to the existing game assets you can find in the installation directory under "assets", and refer to the "Game Content Modding" on the main wiki page.) 1 Link to comment Share on other sites More sharing options...
Foxhostyle Posted March 22, 2020 Author Report Share Posted March 22, 2020 In fact, I want to create a custom mod and I'm currently looking at the wiki page and in the code files to learn how it works. Currently I've created the Kunai object, i.e. the model, the texture and the itemtypes as you can see in the folder that I attached to this message.My problem here is that I'd like my Kunai to be crafted (knapping) as the exact same way that we can craft knife blade/axe head/spear head etc... using stones and/or flint. I already looked for recipes on the main wiki page but I wasn't able to find any about knapping. So far I have only managed to create a grid recipe. Thank you for helping, Fox kunaiMod.zip Link to comment Share on other sites More sharing options...
copygirl Posted March 22, 2020 Report Share Posted March 22, 2020 (edited) I noticed you had a line in your recipe file like this: ingredient: { type: "item", code: "kunai", name: "rock", allowedVariants: ["obsidian", "flint"] }, This means the ingredient item for knapping would be the item you're trying to craft. If you want to have your crafted from both flint and stone, you'll have to make two different recipes, and therefore two different files. ingredient: { type: "item", code: "stone-obsidian" }, ingredient: { type: "item", code: "flint" }, The "name" entry is only useful when you use the variant in the recipe output, like the stone knife recipe does for example. And I have a feeling the inclusion of flint in the allowed variants is an error. As you can see, flint is a completely different item. Other than that, I can only recommend to keep your mod folder name ("assets/kunaiMod"), and other asset filenames ("assets/kunaiMod/shapes/item/kunaiModel.json") all lowercase, as it will otherwise cause issues on other operating systems, which are case-sensitive. And you will need to get rid of the extra "kunaiMod" folder in the .zip file for the game to recognize and load it. To do that, instead of selecting the folder "kunaiMod" and creating a .zip file, go into the folder, select all files, and then create a .zip file from those (you can rename and move it after). Edited March 22, 2020 by copygirl 1 Link to comment Share on other sites More sharing options...
Foxhostyle Posted March 22, 2020 Author Report Share Posted March 22, 2020 Ok, after correcting the code, and took into account that I had to write "game: flint" instead of "flint", I got what I wanted. Thank you very much for your help. Good continuation. Fox 1 Link to comment Share on other sites More sharing options...
Sukotto82 Posted November 27, 2020 Report Share Posted November 27, 2020 I'd like a little more detail about this as I've had similar issues when trying to create a flint and stone-obsidian sawblade. everything looked like it worked I got no error messages but when I go to knap the sawblade head doesn't show up. { ingredient: { type: "item", code: "flint" }, pattern: [[ "__________", "___#______", "__##__#___", "___#__#___", "__##__##__", "___#__#___", "__##__##__", "___#__#___", "__##__##__", "__________" ]], name: "Flint sawblade", output: { type: "item", code: "sawblade-flint" } } { ingredient: { type: "item", code: "stone-*", name: "rock", allowedVariants: ["obsidian", "flint"] }, pattern: [[ "__________", "___#______", "__##__#___", "___#__#___", "__##__##__", "___#__#___", "__##__##__", "___#__#___", "__##__##__", "__________" ]], name: "stone sawblade", output: { type: "item", code: "sawblade-{rock}" } } I basically used the axe/hatchet as a guide and it too had obsidian and flint in the stone section as well as a different recipe for flint by itself. I found this as odd but figured there was a reason behind it but as you said maybe it's just an error so I'll remove flint from the variants section of the stone version but I still have the issue of it simply not showing up as an option when you place down flint or obsidian for knapping. I even had a shape for it but the part that got confusing and the reason why I didn't think it was working is because of this coming part of the code. ... weird I can't find the files that were confusing me. as I looked through everything it looked like I should have no trouble making a recipe for it I guess I would just have to create a second grid recipe or maybe add another option in the existing grid recipe for saw that would use material instead of metal [ { ingredientPattern: "T S", ingredients: { "T": { type: "item", code: "sawblade-*", name: "metal" }, "S": { type: "item", code: "stick" } }, width: 1, height: 2, output: { type: "item", code: "saw-{metal}", quantity: 1 } }, { ingredientPattern: "T S", ingredients: { "T": { type: "item", code: "sawblade-*", name: "material" }, "S": { type: "item", code: "stick" } }, width: 1, height: 2, output: { type: "item", code: "saw-{material}", quantity: 1 } } ] material would cover the flint and stone variants of the saw. 1 Link to comment Share on other sites More sharing options...
DArkHekRoMaNT Posted November 30, 2020 Report Share Posted November 30, 2020 @Sukotto82 Add game: to vanilla item/block codes. Also a stone has block type. Link to comment Share on other sites More sharing options...
Sukotto82 Posted November 30, 2020 Report Share Posted November 30, 2020 thanks Link to comment Share on other sites More sharing options...
Avos Cast Posted February 11, 2021 Report Share Posted February 11, 2021 Did you get this working? I am trying to create flint arrowheads... do you have to make a new model for the item and everything? or does the engine take the textures and stuff? I am a total newbie to this Link to comment Share on other sites More sharing options...
Recommended Posts