Template:Crafting: Difference between revisions
Template page
More actions
m Create Template:Crafting, replicating minecraft.wiki's crafting-grid style without Lua |
m Create Template:Crafting, replicating minecraft.wiki's crafting-grid style without Lua |
||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:Crafting/styles.css" /><span class="mcui mcui-Crafting_Table pixel-image"><span class="mcui-input"><span class="mcui-row"><span class="invslot">{{#if:{{{A1|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{A1name|{{{A1|}}}}}}">[[File:{{{A1|}}}.{{{A1ext|png}}}| | <includeonly><templatestyles src="Template:Crafting/styles.css" /><span class="mcui mcui-Crafting_Table pixel-image"><span class="mcui-input"><span class="mcui-row"><span class="invslot">{{#if:{{{A1|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{A1name|{{{A1|}}}}}}">[[File:{{{A1|}}}.{{{A1ext|png}}}|{{{A1width|32}}}px|link={{{A1link|}}}]]{{#if:{{{A1amount|}}}|<span class="invslot-stacksize">{{{A1amount|}}}</span>}}</span>}}</span><span class="invslot">{{#if:{{{B1|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{B1name|{{{B1|}}}}}}">[[File:{{{B1|}}}.{{{B1ext|png}}}|{{{B1width|32}}}px|link={{{B1link|}}}]]{{#if:{{{B1amount|}}}|<span class="invslot-stacksize">{{{B1amount|}}}</span>}}</span>}}</span><span class="invslot">{{#if:{{{C1|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{C1name|{{{C1|}}}}}}">[[File:{{{C1|}}}.{{{C1ext|png}}}|{{{C1width|32}}}px|link={{{C1link|}}}]]{{#if:{{{C1amount|}}}|<span class="invslot-stacksize">{{{C1amount|}}}</span>}}</span>}}</span></span><span class="mcui-row"><span class="invslot">{{#if:{{{A2|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{A2name|{{{A2|}}}}}}">[[File:{{{A2|}}}.{{{A2ext|png}}}|{{{A2width|32}}}px|link={{{A2link|}}}]]{{#if:{{{A2amount|}}}|<span class="invslot-stacksize">{{{A2amount|}}}</span>}}</span>}}</span><span class="invslot">{{#if:{{{B2|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{B2name|{{{B2|}}}}}}">[[File:{{{B2|}}}.{{{B2ext|png}}}|{{{B2width|32}}}px|link={{{B2link|}}}]]{{#if:{{{B2amount|}}}|<span class="invslot-stacksize">{{{B2amount|}}}</span>}}</span>}}</span><span class="invslot">{{#if:{{{C2|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{C2name|{{{C2|}}}}}}">[[File:{{{C2|}}}.{{{C2ext|png}}}|{{{C2width|32}}}px|link={{{C2link|}}}]]{{#if:{{{C2amount|}}}|<span class="invslot-stacksize">{{{C2amount|}}}</span>}}</span>}}</span></span><span class="mcui-row"><span class="invslot">{{#if:{{{A3|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{A3name|{{{A3|}}}}}}">[[File:{{{A3|}}}.{{{A3ext|png}}}|{{{A3width|32}}}px|link={{{A3link|}}}]]{{#if:{{{A3amount|}}}|<span class="invslot-stacksize">{{{A3amount|}}}</span>}}</span>}}</span><span class="invslot">{{#if:{{{B3|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{B3name|{{{B3|}}}}}}">[[File:{{{B3|}}}.{{{B3ext|png}}}|{{{B3width|32}}}px|link={{{B3link|}}}]]{{#if:{{{B3amount|}}}|<span class="invslot-stacksize">{{{B3amount|}}}</span>}}</span>}}</span><span class="invslot">{{#if:{{{C3|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{C3name|{{{C3|}}}}}}">[[File:{{{C3|}}}.{{{C3ext|png}}}|{{{C3width|32}}}px|link={{{C3link|}}}]]{{#if:{{{C3amount|}}}|<span class="invslot-stacksize">{{{C3amount|}}}</span>}}</span>}}</span></span></span><span class="mcui-arrow">[[File:Crafting arrow.png|32px|link=]]</span><span class="mcui-output"><span class="invslot invslot-large">{{#if:{{{Output|}}}|<span class="invslot-item invslot-item-image" data-tooltip="{{{Outputname|{{{Output|}}}}}}">[[File:{{{Output|}}}.{{{Outputext|png}}}|{{{Outputwidth|32}}}px|link={{{Outputlink|}}}]]{{#if:{{{Outputamount|}}}|<span class="invslot-stacksize">{{{Outputamount|}}}</span>}}</span>}}</span></span>{{#if:{{{shapeless|}}}|<span class="mcui-icons"><span class="mcui-shapeless" title="This recipe is shapeless; the inputs may be placed in any arrangement in the crafting grid.">[[File:Shapeless crafting icon.png|19x15px|link=]]</span></span>}}</span></includeonly><noinclude> | ||
== Usage == | == Usage == | ||
| Line 31: | Line 31: | ||
| <code>A1ext</code>–<code>C3ext</code> | | <code>A1ext</code>–<code>C3ext</code> | ||
| Overrides the assumed <code>.png</code> extension (e.g. <code>jpg</code>, <code>svg</code>) for that slot's file, for the rare icon that isn't a PNG. | | Overrides the assumed <code>.png</code> extension (e.g. <code>jpg</code>, <code>svg</code>) for that slot's file, for the rare icon that isn't a PNG. | ||
|- | |||
| <code>A1width</code>–<code>C3width</code> | |||
| Overrides the default width of <code>32</code> (in pixels, no unit) for that slot's icon. Only needed for a genuinely non-square file — work out the value that gives the right height (e.g. a 5×12 icon needs <code>width=13</code> to come out ~32px tall) and the icon still centres itself in the slot. | |||
|- | |- | ||
| <code>A1link</code>–<code>C3link</code> | | <code>A1link</code>–<code>C3link</code> | ||
| Line 41: | Line 44: | ||
| Overrides the hover-tooltip text for that slot (e.g. <code>A1name=Gold Ingot (any)</code>) instead of using <code>A1</code> itself. | | Overrides the hover-tooltip text for that slot (e.g. <code>A1name=Gold Ingot (any)</code>) instead of using <code>A1</code> itself. | ||
|- | |- | ||
| <code>Output</code>, <code>Outputext</code>, <code>Outputlink</code>, <code>Outputamount</code>, <code>Outputname</code> | | <code>Output</code>, <code>Outputext</code>, <code>Outputwidth</code>, <code>Outputlink</code>, <code>Outputamount</code>, <code>Outputname</code> | ||
| Same | | Same six options as a grid slot, for the larger output slot on the right. | ||
|- | |- | ||
| <code>shapeless</code> | | <code>shapeless</code> | ||
Latest revision as of 09:38, 24 August 2026
Usage
{{Crafting
|A1=Gold Ingot |B1=Gold Ingot |C1=Gold Ingot
|A2=Gold Ingot |B2=Diamond |C2=Gold Ingot
|A3=Gold Ingot |B3=Gold Ingot |C3=Gold Ingot
|Output=Lapis Lazuli Block |Outputamount=1
}}
Renders as: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
1
Replicates the visual style of minecraft.wiki's Template:Crafting — a beveled 3×3 grid of recessed item slots, an arrow, a larger output slot, and hover tooltips — without Lua/Scribunto, which this wiki doesn't have. The trade-off: nothing is looked up automatically from an item name, so every slot needs its own filename (and optionally a link and stack-size label) spelled out, and the hover tooltip is a pure-CSS box anchored above the slot rather than minecraft.wiki's own cursor-following JS gadget.
Parameters
| Parameter | Description |
|---|---|
A1–C3
|
The icon shown in that grid position, as its filename without the extension (e.g. Gold Ingot for File:Gold Ingot.png). Left blank for an empty slot. Also becomes the default hover-tooltip text for that slot.
|
A1ext–C3ext
|
Overrides the assumed .png extension (e.g. jpg, svg) for that slot's file, for the rare icon that isn't a PNG.
|
A1width–C3width
|
Overrides the default width of 32 (in pixels, no unit) for that slot's icon. Only needed for a genuinely non-square file — work out the value that gives the right height (e.g. a 5×12 icon needs width=13 to come out ~32px tall) and the icon still centres itself in the slot.
|
A1link–C3link
|
Optional page the slot's icon links to. Left blank, the icon isn't clickable. |
A1amount–C3amount
|
Optional stack-size number shown in the slot's corner (e.g. 4).
|
A1name–C3name
|
Overrides the hover-tooltip text for that slot (e.g. A1name=Gold Ingot (any)) instead of using A1 itself.
|
Output, Outputext, Outputwidth, Outputlink, Outputamount, Outputname
|
Same six options as a grid slot, for the larger output slot on the right. |
shapeless
|
Set to 1 (or any non-empty value) to show the shapeless-recipe badge in the top-right corner — hovering it explains what it means, same as on minecraft.wiki.
|