Confirmedusers
536
edits
(Changed separator (tab -> comma); added that space cannot be separator; partially updated to 1.16 (needs additional check and new mod zip)) |
m (Added out-of-date notice.) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
<translate> | <translate> | ||
{{GameVersion|1. | <!--T:40--> | ||
{{GameVersion|1.19}} | |||
<!--T:1--> | <!--T:1--> | ||
__FORCETOC__ | __FORCETOC__ | ||
{{PageOutdated|lookat={{ll|Modding:Content_Tutorial_Simple_Recipe|the simple recipes tutorial|nsp=0}}}} | |||
Before creating recipes, we suggest you read [[Basic Item]] first in order to understand this tutorial. | Before creating recipes, we suggest you read [[Basic Item]] first in order to understand this tutorial. | ||
Line 145: | Line 148: | ||
Sometimes you want to keep one or more of the ingredients, but convert them to a different item after crafting. For example, when crafting a honey-sulfur poultice, the player needs a bowl filled with honey, but the bowl is not consumed to craft it. Instead the bowl of honey is turned into an empty bowl. This is accomplished by adding the <code>returnedStack</code> property to the ingredient. This property's value needs to contain a <code>type</code> and <code>code</code> just like the standard ingredient properties. This tells the recipe which item to give the player back. | Sometimes you want to keep one or more of the ingredients, but convert them to a different item after crafting. For example, when crafting a honey-sulfur poultice, the player needs a bowl filled with honey, but the bowl is not consumed to craft it. Instead the bowl of honey is turned into an empty bowl. This is accomplished by adding the <code>returnedStack</code> property to the ingredient. This property's value needs to contain a <code>type</code> and <code>code</code> just like the standard ingredient properties. This tells the recipe which item to give the player back. | ||
<!--T:41--> | |||
Continuing with the honey-sulfur poultice example, a bowl of honey as an ingredient looks like <code>"B": { type: "block", code: "bowl-honey" }</code>, but the player would lose the bowl if the recipe were written this way. We need to add <code>returnedStack</code> to the ingredient's properties and indicate which item to replace it with. In this case, the player should receive an empty bowl in place of the bowl of honey <code>returnedStack: { type: "block", code: "bowl-burned" }</code>. This property is placed alongside the <code>type</code> and <code>code</code> properties of an ingredient. Putting it all together: | Continuing with the honey-sulfur poultice example, a bowl of honey as an ingredient looks like <code>"B": { type: "block", code: "bowl-honey" }</code>, but the player would lose the bowl if the recipe were written this way. We need to add <code>returnedStack</code> to the ingredient's properties and indicate which item to replace it with. In this case, the player should receive an empty bowl in place of the bowl of honey <code>returnedStack: { type: "block", code: "bowl-burned" }</code>. This property is placed alongside the <code>type</code> and <code>code</code> properties of an ingredient. Putting it all together: | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
Line 194: | Line 198: | ||
}, | }, | ||
{ | { | ||
ingredientPattern: "P_P PSP P_P", | ingredientPattern: "P_P,PSP,P_P", | ||
ingredients: { | ingredients: { | ||
"P": { type: "item", code: "plank-*" }, | "P": { type: "item", code: "plank-*" }, | ||
Line 238: | Line 242: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<!--T:39--> | === Hiding recipes from 'Created by' section from handbook === <!--T:39--> | ||
{{Navbox/ | Some recipes are better hidden, it can be done by adding <code>showInCreatedBy</code>. | ||
<syntaxhighlight lang="json"> | |||
{ | |||
ingredientPattern: "H", | |||
ingredients: { | |||
"H": { type: "block", code: "hay-normal-ud" } | |||
}, | |||
showInCreatedBy: false, | |||
width: 1, | |||
height: 1, | |||
output: { type: "item", code: "drygrass", quantity: 8 } | |||
} | |||
</syntaxhighlight> | |||
=== Using liquid container as ingredient === <!--T:40--> | |||
Some recipes use liquid containers, such as buckets, bowls or jugs. For single liquid container, it can be done by adding <code>liquidContainerProps</code> to recipe attributes. This is recipe for honey-sulfur poultice: | |||
<syntaxhighlight lang="json"> | |||
{ | |||
ingredientPattern: "SBS,_L_", | |||
ingredients: { | |||
"L": { type: "block", code: "linen-*" }, | |||
"S": { type: "item", code: "powderedsulfur" }, | |||
"B": { type: "block", code: "bowl-fired" } | |||
}, | |||
attributes: { | |||
liquidContainerProps: { | |||
requiresContent: { type: "item", code: "honeyportion" }, | |||
requiresLitres: 0.25 | |||
} | |||
}, | |||
width: 3, | |||
height: 2, | |||
output: { type: "item", code: "poultice-linen-honey-sulfur", quantity: 4 } | |||
} | |||
</syntaxhighlight> | |||
<!--T:41--> | |||
{{Navbox/contentmodding}} | |||
</translate> | </translate> |