Modding:Content Tutorial Simple Recipe: Difference between revisions

From Vintage Story Wiki
Finished the "going further" section.
m (Minor formatting)
(Finished the "going further" section.)
Line 259: Line 259:
Want to make some additional changes to this mod? Try and achieve the following things!
Want to make some additional changes to this mod? Try and achieve the following things!


Change the color of the block
Gold ingots are too expensive... change the block recipe to use gold bits instead. Note that the code for gold bits is "''game:metalbit-gold".''
{| class="wikitable mw-collapsible mw-collapsed"
{| class="wikitable mw-collapsible mw-collapsed"
|To achieve this...
|To achieve this...
|-
|-
|Modify the ''shinygoldtexture.png'' texture to a different color.
|In '''simpleblockrecipe.json','' modify "''game:ingot-gold''" to "''game:metalbit-gold''".
|}
|}
Change the block to only be mined with at least a tier 1 tool. Note that you will have to add a new "''requiredToolTier"'' property
Create another grid recipe that uses a simple wand and a single charcoal to make a diamond. The codes are "''simplewand''", "''game:charcoal''", and "''game:gem-diamond-rough''" respectively. Note that the wand should be consumed on use - Using the "''onTool''" property will cause your recipe to not work as the simple wand is not defined as a tool.
{| class="wikitable mw-collapsible mw-collapsed"
{| class="wikitable mw-collapsible mw-collapsed"
|To achieve this...
|To achieve this...
|-
|-
|Add ''"requiredToolTier":1'' to the blocktype file.
|Create a new charcoaltodiamond.json recipe inside ''recipes/grid''.  
|}
Your file may look similar to this:<syntaxhighlight lang="json">
Change your modid <nowiki/>and domain<nowiki/> to something else
{
<nowiki/>
"ingredientPattern": "W,C",
{| class="wikitable mw-collapsible mw-collapsed"
"width": 1,
|To achieve this...
"height": 2,
|-
"ingredients": {
|Modify both the modid entry in ''modinfo.json'', and change the name of the '<nowiki/>''simplebloc''<nowiki/>''k''<nowiki/>' folder in '''asset''<nowiki/>''s''<nowiki/>'.
"W": {
|}
"type": "item",
Rename your 'Simple Gold Block'
"code": "simplewand"
{| class="wikitable mw-collapsible mw-collapsed"
},
|To achieve this...
"C": {
|-
"type": "item",
|Change the entry for simplegoldblock in your ''en.json'' lang file.
"code": "game:charcoal"
|}
}
Create another block with a different texture and properties
},
{| class="wikitable mw-collapsible mw-collapsed"
"output": {
|To achieve this...
"type": "item",
|-
"code": "game:gem-diamond-rough"
|Create a new block texture with a different name, and a duplicate blocktype file. In the new blocktype file, change the block code and change the texture property to your new texture path. Modify the properties to change the type of block. Don't forget to add new lang translation entries!
}
}
</syntaxhighlight>
|}
|}


</translate>
</translate>
{{Navbox/contentmodding}}
{{Navbox/contentmodding}}
Confirmedusers
536

edits