Jump to: navigation, search

Template:Crafting: Difference between revisions

No edit summary
No edit summary
Line 41: Line 41:
#if: {{{nocat|}}}{{NAMESPACE}}{{#pos: {{#var: items }} | : }}{{{mod|}}}{{#pos: {{PAGENAME}} | / }}
#if: {{{nocat|}}}{{NAMESPACE}}{{#pos: {{#var: items }} | : }}{{{mod|}}}{{#pos: {{PAGENAME}} | / }}
| <!-- No cats -->
| <!-- No cats -->
| {{#invoke:CraftingDPL|parseCats|{{#var: items }}}}
| {{
</includeonly>
  #if: {{#pos: {{#var: items }} | ;Stick; }}
  | [[Category:Recipe using Stick]]
  }}{{
  #if: {{#pos: {{#var: items }} | ;Cobblestone; }}
  | [[Category:Recipe using Cobblestone]]
  }}{{
  #if: {{#pos: {{#var: items }} | ;Glass; }}
  | [[Category:Recipe using Glass]]
  }}{{
  #if: {{#pos: {{#var: items }} | WoodPlanks }}
  | [[Category:Recipe using Wood Planks]]
  }}{{
  #if: {{#pos: {{#var: items }} | Wool }}
  | [[Category:Recipe using Wool]]
  }}{{
  #if: {{#pos: {{#var: items }} | ;Blockof }}
  | [[Category:Recipe using mineral block]]
  }}{{
  #if: {{#pos: {{#var: items }} | ;Redstone; }}
  | [[Category:Recipe using Redstone]]
  }}{{
  #if: {{#pos: {{#var: items }} | ;RedstoneTorch; }}
  | [[Category:Recipe using Redstone Torch]]
  }}
}}</includeonly>
<noinclude>
<noinclude>
{{Template:Crafting/doc}}
{{Template:Crafting/doc}}
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 20:23, 13 February 2014


Template-info.png Documentation
Lua logo.svg
This template uses Module:Crafting, a script written in the Lua programming language. Please see wp:Lua and mw:Extension:Scribunto to learn more about Lua.

Using this template, you can create tables like those commonly used in the “Crafting” and “As a crafting ingredient” sections of articles about blocks and items. It can be used similarly to {{Grid/Crafting Table}}, except it creates the table for you.

By default, the table generates with 3 columns: Name, Ingredients, and the main column containing {{Grid/Crafting Table}}. You can set the parameter {{{mode=noname}}} in the first template of the table to hide the Name column. You also need to set {{{foot=1}}} in the last template of the table.

Displaying a shapeless recipe can be accomplished by simply leaving out the grid positions for all ingredients. If the recipe is shapeless and uses less than 5 slots, the template will automatically arrange the items into the bottom-left square, indicating that the recipe can be used in the inventory crafting area.

Example usage:

{{Crafting
  |head=1
  |B2=Coal
  |B3=Stick
  |Output=Torch,4
}}
{{Crafting
  |Blaze Powder
  |Gunpowder
  |Coal
  |Output=Fire Charge,3
  }}
{{Crafting
  |A1= Coal |B1= Coal |C1= Coal
  |A2= Coal |B2= Coal |C2= Coal
  |A3= Coal |B3= Coal |C3= Coal
  |Output=Block of Coal
  |upcoming=1
}}
{{Crafting
  |name=[[Pickaxe]]
  |ingredients=[[Stick]]s +<br>[[Wood Planks]] or<br> [[Cobblestone]] or<br>[[Iron Ingot]]s or<br>[[Gold Ingot]]s or<br>[[Diamond]]s
  |A1=Wooden Plank; Cobblestone; Iron Ingot; Gold Ingot; Diamond 
  |B1=Wooden Plank; Cobblestone; Iron Ingot; Gold Ingot; Diamond 
  |C1=Wooden Plank; Cobblestone; Iron Ingot; Gold Ingot; Diamond 
  |B2=Stick
  |B3=Stick
  |Output=Wooden Pickaxe; Stone Pickaxe; Iron Pickaxe; Gold Pickaxe; Diamond Pickaxe
  |foot=1
}}

produces:

NameIngredientsCrafting recipe
TorchCoal +
Stick



Grid layout Arrow (small).png Torch4

Coal

Stick
Fire ChargeBlaze Powder +
Gunpowder +
Coal



Grid layout Arrow (small).png Fire Charge3
Gunpowder Blaze Powder

Coal
Grid layout Shapeless.png
Block of Coal
(upcoming)
Coal
Coal Coal Coal Grid layout Arrow (small).png Block of Coal
Coal Coal Coal
Coal Coal Coal
PickaxeSticks +
Wood Planks or
Cobblestone or
Iron Ingots or
Gold Ingots or
Diamonds
Wooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamond Wooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamond Wooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamondWooden PlankCobblestoneIron IngotGold IngotDiamond Grid layout Arrow (small).png Wooden PickaxeStone PickaxeIron PickaxeGold PickaxeDiamond PickaxeWooden PickaxeStone PickaxeIron PickaxeGold PickaxeDiamond PickaxeWooden PickaxeStone PickaxeIron PickaxeGold PickaxeDiamond PickaxeWooden PickaxeStone PickaxeIron PickaxeGold PickaxeDiamond PickaxeWooden PickaxeStone PickaxeIron PickaxeGold PickaxeDiamond Pickaxe

Stick

Stick




Cookies help us deliver our services. By using our services, you agree to our use of cookies.