Template:Infobox block: Difference between revisions

horizontal inv image
No edit summary
 
(316 intermediate revisions by 54 users not shown)
Line 1: Line 1:
<table class="infobox" cellpadding="4" style="width: 22em; font-size: 90%; float:right; border: 1px solid #AAAAAA; margin-left:0.5em">
{{#invoke:infobox|infobox
<tr>
| invimage = title
  <td align="center" colspan=2 style="font-size:120%; font-weight: bold; background-color: #CCCCCC;">{{{name|{{BASEPAGENAME}}}}}</td>
| rows =
</tr>
{{#if: {{{rarity|}}} | {{infobox row|class=list-style-none|label=[[minecraft:Rarity|Rarity color]]|field={{ucfirst:{{{rarity|}}}}} }} | }}
<tr valign="top">
{{#if: {{{renewable|}}} | {{infobox row|label=[[minecraft:Renewable resource|Renewable]]|field={{{renewable}}} }} }}
  <td align="center" colspan="2">[[File:{{{image|No block image.png}}}|150px|center]]</td>
{{#if: {{{stackable|}}} | {{infobox row|label=Stackable|field={{{stackable}}} {{#if: {{{maxStack|}}} | &nbsp;({{{maxStack}}}) }} }} |<!-- {{{stackable}}} not provided => --->{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing stackability}}}} }}
</tr>
{{infobox row|label=Tool{{ #if: {{{tool2|}}} | s }}|class=pixel-image|field={{{tool|}}}{{
{{#if:{{{image2|}}}|<tr valign="top"><td align="center" colspan="2">[[File:{{{image2}}}|150px|center]]</td></tr>}}
  #if: {{{tool2|}}} | {{{tool2|}}}
{{#if:{{{image3|}}}|<tr valign="top"><td align="center" colspan="2">[[File:{{{image3}}}|150px|center]]</td></tr>}}
}}{{
{{#if:{{{invimage|}}}|<tr valign="top"><td align="center" colspan="2">[[File:{{{invimage}}}|36px|center]]{{#if:{{{invimage2|}}}|&nbsp;[[File:{{{invimage2}}}|36px|center]]{{#if:{{{invimage3|}}}|&nbsp;[[File:{{{invimage3}}}|36px|center]]}}}}</td></tr>}}
  #if: {{{tool3|}}} | {{{tool3|}}}
{{Block/row2|label=Type|field={{{type|?}}}}}
}} }}
{{#switch:{{lc:{{{type}}}}}|solid block|solid|block =
{{infobox row|label=[[minecraft:Explosion#Blast resistance|Blast resistance]]|field={{ #if: {{{tntres|}}}
{{Block/row|label=Requirements|field={{#switch:{{lc:{{{dirt}}}}}|yes=Sunlight and dirt|no=None|sand=Sunlight and sand|#default={{{dirt|?}}}}}}}}}
| {{{tntres}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden tntres}} }}
{{#if:{{{notes|}}}|<tr valign="top" style="background: {{{#FFFFFF}}};"><td colspan="2">{{{notes|}}}</td></tr>}}
| {{Blast resistance values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
{{Block/row2|label=Physics|field={{{gravity|?}}}}}
}} }}
{{Block/row|label=Transparency|field={{{transparent|?}}}}}
{{infobox row|label=[[minecraft:Breaking#Blocks by hardness|Hardness]]|field={{ #if: {{{hardness|}}}
{{Block/row2|label=Luminance|field={{{light|?}}}}}
| {{{hardness}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden hardness}} }}
{{Block/row|label=[[Explosion#Block_Resistance|Block Resistance]]|field={{{tntres|? blocks}}}}}
| {{Hardness values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
{{Block/row2|label=Tool{{#if:{{{tool2|}}}|s}}|field={{#switch:{{lc:{{{tool|{{{Tool}}}}}}}}<!--
}} }}
-->|pick|pickaxe=[[File:Use-pickaxe.png|32px|link=Tools#Pickaxe|Pickaxe]]<!--
{{#if: {{{durability|}}} |{{infobox row|Durability|{{{durability|}}}}}}}
-->|spade|shovel=[[File:Use-spade.png|32px|link=Tools#Shovel|Shovel]]<!--
{{infobox row|label=[[minecraft:Light|Luminous]]|field={{ #if: {{{light|}}} | {{{light}}} {{#if: {{{lightLevel|}}} | &nbsp;({{{lightLevel}}}) }} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing luminance}}}} }} }}
-->|axe=[[File:Use-axe.png|32px|link=Tools#Axe|Axe]]<!--
{{infobox row|label=[[minecraft:Opacity|Transparent]]|field={{ #if: {{{transparent|}}} | {{{transparent}}} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing transparency}}}} }} }}
-->|hoe=[[File:Use-hoe.png|32px|link=Tools#Hoe|Hoe]]<!--
{{ #if: {{{waterloggable|}}} | {{infobox row|label=[[minecraft:Waterlogging|Waterloggable]]|field={{{waterloggable}}} }} }}
-->|bucket|pail=[[File:Use-bucket.png|32px|link=Tools#Bucket|Bucket]]<!--
{{ #if: {{{heals|}}} | {{infobox row|label=[[minecraft:Food|Restores]]|field={{{heals}}} }} }}
-->|sword=[[File:Use-sword.png|32px|link=Tools#Sword|Sword]]<!--
{{infobox row|label=[[minecraft:Flammable|Flammable]]|field={{ #if: {{{flammable|}}} | {{{flammable}}} | ?{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing flammability}}}} }} }}
-->|n/a|none=None<!--
{{infobox row|label=Catches fire from [https://minecraft.wiki/w/Lava Lava]|field={{ #if: {{{lavasusceptible|}}} | {{{lavasusceptible}}} | ?{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing lava susceptibility}}}} }} }} }}
-->|all|alltools|any|anytool=Any tool<!--
{{#if: {{NAMESPACE}} ||
-->|#default=?}}<!--
{{translation category|project=0|{{
-->{{#if:{{{tool2|}}}|{{#switch:{{lc:{{{tool2}}}}}<!--
  #switch: {{lc: {{{renewable|}}} }}
-->|pick|pickaxe=[[File:Use-pickaxe.png|32px|link=Tools#Pickaxe|Pickaxe]]<!--
  | yes = Renewable resources
-->|spade|shovel=[[File:Use-spade.png|32px|link=Tools#Shovel|Shovel]]<!--
  | no = Non-renewable resources
-->|axe=[[File:Use-axe.png|32px|link=Tools#Axe|Axe]]<!--
  | Resources with invalid renewability
-->|hoe=[[File:Use-hoe.png|32px|link=Tools#Hoe|Hoe]]}}}}}}
}}}}
{{Block/row|label=Stackable|field={{{stackable|?}}}}}
}}<noinclude>
{{#switch:{{lc:{{{type}}}}}|fluid =
{{documentation}}
{{Block/row2|label=Speed of fluid movement|field={{{fluidspeed|?}}}}}
<!-- Put categories/interwiki on the documentation page -->
{{Block/row|label=Speed of walking through|field={{{movespeed|?}}}}}}}
</noinclude>
{{Block/row2|label=[[Data values|Data value]]{{#if:{{{data2|}}}|s|}}|field={{{data|{{#if:{{{datadec|}}}|<!--
 
 
---->|{{#if:{{{data1name|}}}|'''{{{data1name|}}}'''<br />| }}<!--
----><sub>dec:</sub> {{{data1|00}}} <sub>hex:</sub> {{dec-hex|{{{data1|00}}} }}<br /><!--
 
The optional second data value.
 
---->{{#if:{{{data2|}}}|<!--
------>{{#if:{{{data2name|}}}|'''{{{data2name|}}}'''<br />| }}<!--
------><sub>dec:</sub> {{{data2}}} <sub>hex:</sub> {{dec-hex|{{{data2}}} }}<!--
---->|}}<!--
-->}} }}} }}
</table><noinclude><!---
--->
==Documentation==
'''These usage notes will not be included in articles bearing this template.'''
 
This template provides a uniform design for block pages.
<pre>
{{Block
|image=
|image2=
|image3=
|invimage=
|invimage2=
|invimage3=
|type=
|gravity=
|dirt=
|transparent=
|light=
|tntres=
|tool=
|stackable=
|data1name=
|data1=
|data2name=
|data2=
|fluidspeed=
|movespeed=
}}</pre>
 
{| class=grid
! Parameter
! Function
! Default value
|-
| <code>name</code> || Only needed to change the name from the page name || <code><nowiki>{{BASEPAGENAME}}</nowiki></code>
|-
| <code>image</code> || Image of the block (should be approx. 150x150px) || [[:File:No block image.png|No block image.png]]
|-
| <code>image2</code> || Second image for two-state blocks (also approx. 150x150px) || ''None''
|-
| <code>image3</code> || Third image for three-state blocks (also approx. 150x150px) || ''None''
|-
| <code>invimage</code> || Image for object in inventory (should be approx. 36x36px) || ''None''
|-
| <code>invimage2</code> || Second image for two-state objects in inventory (should be approx. 36x36px) || ''None''
|-
| <code>invimage3</code> || Third image for three-state objects in inventory (should be approx. 36x36px) || ''None''
|-
| <code>type</code> || Type (solid block, solid, block, or fluid) || ?
|-
| <code>gravity</code> || Affected by gravity? || ?
|-
| <code>dirt</code> || Requires sunlight/dirt? || ?
|-
| <code>transparent</code> || Allows light to pass through? || ?
|-
| <code>light</code> || Emits Light? || ?
|-
| <code>tntres</code> || How many blocks in any direction will a TNT explosion pass through? || ?
|-
| <code>tool</code> || Tool to use || ?
|-
| <code>stackable</code> || Stackable || ?
|-
| <code>data1name</code> || If using multiple data values, specify a name || ''None''
|-
| <code>data1</code> || Decimal Data Value 1 || 00
|-
| <code>data2name</code> || Data 2's name || ''None''
|-
| <code>data2</code> || Decimal Data Value 2 || ''None''
|}
[[Category:Templates]]</noinclude>
<includeonly>{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{lc:{{{type|}}}}}|item|[[Category:Items]]|[[Category:Blocks]]}}}}</includeonly>