Difference between revisions of "Template:AdvancementIcon"

From Gamemode 4
Jump to navigation Jump to search
(Comment out file if, all sprites can be accessed by Slot. Just make sure to gm4: if it's not from MC)
m (Please let me sleep)
Line 1: Line 1:
 
<includeonly><span class style="display: inline-block; position: relative; width: 52px; height: 52px;">
 
<includeonly><span class style="display: inline-block; position: relative; width: 52px; height: 52px;">
 
[[File:Advancement-{{{2|{{{bg|plain}}}}}}-{{{3|{{{state|raw}}}}}}.png|link=]]
 
[[File:Advancement-{{{2|{{{bg|plain}}}}}}-{{{3|{{{state|raw}}}}}}.png|link=]]
{{Slot
+
{{Stack
| Item={{{ 1 | Grass Block}}}
+
| Item = {{{ 1 | Grass Block}}}
 
| link = {{{link|}}}
 
| link = {{{link|}}}
 +
| inline = true
 
}}
 
}}
 
<--
 
<--
 
{{#if: {{{file|}}}
 
{{#if: {{{file|}}}
 
| [[File:{{{file}}}| link{{{link|}}}|32px]]
 
| [[File:{{{file}}}| link{{{link|}}}|32px]]
| {{Slot
+
| {{Stack
| Item={{{1|Grass Block}}}
+
| Item = {{{1|Grass Block}}}
| link={{{link|}}}
+
| link = {{{link|}}}
 +
| inline = true
 
  }}
 
  }}
 
}}-->
 
}}-->

Revision as of 09:49, 22 May 2020

Template documentation[view] [edit] [history] [purge]

Using this template, you can create the advancement icons as seen within the game.

The images used are taken from {{InvSprite}}.

Advancement-plain-raw.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

Usage

Image

Using the first parameter, {{{1}}}, you can set the image to the specified block or item or a fallback image.

For Gamemode 4 specific items or blocks, gm4: must prefix the name, e.g., gm4:Boots of Ostara

Background

Optional. The second parameter, {{{bg}}}, is used to set the background.

Optional. The third parameter, {{{state}}}, is used to display advancement completion state.

Background Parameters

Advancement-plain-raw.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

plain|raw

Advancement-oval-raw.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

oval|raw

Advancement-fancy-raw.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

fancy|raw

Advancement-plain-worn.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

plain|worn

Advancement-oval-worn.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

oval|worn

Advancement-fancy-worn.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

fancy|worn

Link

NOTE: Link is not implemented, as {{AdvancementIcon}} currently uses {{Stack}} and not {{InventoryIcon}}.

Optional. An advancement icon can contain a link using {{{link}}}.

To link Boots of Ostara, you would use {{AdvancementIcon|gm4:Boots of Ostara|link=Boots of Ostara}}.

Example Usage

Advancement Icons can be placed inline by placing two {{AdvancementIcon}}s next to one another, without spaces or newlines.

New lines and spacing within {{AdvancementIcon}} is ignored, as long as the parameter is stated, e.g., bg = plain.

The second and third parameters can be written inline, as shown in the last example, but unless the template is written without spaces, the output will fail.

{{AdvancementIcon
 | Furnace
 | bg = plain
 | state = raw}}{{AdvancementIcon|Furnace|bg = oval|state = worn}}

{{AdvancementIcon
 | gm4:SCUBA Helmet
 | bg = fancy
 | state = worn
 | link = SCUBA Gear
}}{{AdvancementIcon|Diamond Hoe|fancy|raw}}

Advancement-plain-raw.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).--> Advancement-oval-worn.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

Advancement-fancy-worn.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).--> Advancement-fancy-raw.png Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value). <-- Lua error in Module:Crafting at line 82: attempt to index local 'sprite' (a nil value).-->

See Also