• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

How do I hide or blacklist certain recipes or Items from the game?

LastTugBoat243

New member
I want to make a mod that adds a new recipe for an already existing item in the game. But I want to hide the current one first. How would I go about doing that?

 
Last edited by a moderator:
「recipes.xml」 but it seems to be a file related to recipes。

example:AOO

\7 Days To Die\Mods\00-AOO_Core_Vehicles\Config\recipes.xml

 
Yeah, look at that file and find the recipes you don't want. Then on your mod, use XPATH to remove/delete that recipe (remove/delete the entire recipe). I believe you can delete recipes and not affect anything. 

 
Last edited:
I want to make a mod that adds a new recipe for an already existing item in the game. But I want to hide the current one first. How would I go about doing that?


If you are just changing the ingredients couldn't you just change the ones in the recipe. For example for shotgun shells...

<recipe name="ammoShotgunShell" count="1" craft_area="workbench" tags="workbenchCrafting">
    <ingredient name="resourceBuckshot" count="1"/>
    <ingredient name="resourceGunPowder" count="4"/>
    <ingredient name="resourcePaper" count="1"/>
</recipe>

<recipe name="ammoShotgunShell" count="1" craft_area="workbench" tags="workbenchCrafting">
    <ingredient name="resourceAnimalFat" count="3"/>
    <ingredient name="resourceScrapPolymers" count="2"/>
    <ingredient name="resourceFeather" count="1"/>
</recipe>

I am not sure how to do the xpath thing to change it without actually changing in in the recipes.xml file but am sure someone could help you.

 
I am not sure how to do the xpath thing to change it without actually changing in in the recipes.xml file but am sure someone could help you.


What I have done in the past (using your example of the shotgun shell):

<append xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourcePaper']">
    <ingredient name="resourceAnimalFat" count="3"/>
    <ingredient name="resourceScrapPolymers" count="2"/>
    <ingredient name="resourceFeather" count="1"/>
</append>

<remove xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourcePaper']"/>
<remove xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourceBuckshot']"/>
<remove xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourceGunPowder']"/>




I would add the items to the existing recipe (adding after resourcePaper) and then remove the old items I want to remove.

 
Last edited by a moderator:
Another way is to merely use "set" to change the values - as part of a Mod, and using only three lines in a recipes.xml:

<set xpath="/recipes/recipe[@name='ammoShotgunShell']/ingredient[@name='resourceBuckshot']/@name">resourceScrapPolymers</set>
<set xpath="/recipes/recipe[@name='ammoShotgunShell']/ingredient[@name='resourceGunPowder']/@name">resourceFeather</set>
<set xpath="/recipes/recipe[@name='ammoShotgunShell']/ingredient[@name='resourcePaper']/@name">resourceAnimalFat</set>

Looking at the the "Saves\(World)\ConfigsDump\recipes.xml" file - it will show the actual code as it has worked during the last load:

<recipe name="ammoShotgunShell" count="1" craft_area="AmmoWeaponWorkBench" tags="workbenchCrafting"><!--Attribute "craft_area" replaced by: "Red22"-->
    <ingredient name="resourceScrapPolymers" count="1"><!--Attribute "name" replaced by: "Red22"--></ingredient>
    <ingredient name="resourceFeather" count="4"><!--Attribute "name" replaced by: "Red22"--></ingredient>
    <ingredient name="resourceAnimalFat" count="1"><!--Attribute "name" replaced by: "Red22"--></ingredient>
</recipe>

(Red22 is just the name of my own mod).
I'm not sure quite what you mean, or are trying to achieve by "hiding" the (games?) original code, as any removing of the (modname)\Config\recipe.xml, from the game will simply cause the game to load its own default recipes.xml - which doesn't - or shouldn't - get modified by your mod.  
 

 
Last edited by a moderator:
Back
Top