Template:Item: Difference between revisions

From StrawberryMC
CmdBlock00 (talk | contribs)
No edit summary
CmdBlock00 (talk | contribs)
mNo edit summary
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
== 🎒 How to Use This Template ==
== Parameters ==
test
{| class="wikitable"
<div style="background:#f4f4f4; border:1px solid #ccc; padding:10px; margin-bottom:1em;">
|+ Caption text
📋 Just copy and paste this example and edit the values:
|-
! Parameter !! Extra Information !! Required<br>(Y/N)
|-
| ''name'' ||The item's name (e.g. Iron Sword)|| Yes
|-
| ''image'' ||An image of the item|| Yes
|-
| ''lore'' ||Do <nowiki>"<br>"</nowiki> for new line|| No
|-
| ''[[Rarity|rarity]]'' ||The item's rarity|| Yes
|-
| ''type'' ||The item's type (e.g. food, weapon)|| Yes
|-
| ''[[stats]]'' ||Use the stat as the parameter || No
|-
|}
[[Magic Find|magicFind]] [[Fortune|fortune]] [[Blast|blast]] income exp [[Speed|speed]] [[Digging Power|diggingPower]]


<pre>
== Example ==
{{Item
{{Item
  | name          = Shadow Pickaxe
  | name          = Item Name
| image        = File:Placeholder.png
| lore          = Nothing.
| type          = tool
  | rarity        = epic
  | rarity        = epic
| image        = File:ShadowPickaxe.png
  | magicFind    = 10
  | magicFind    = 10%
  | fortune      = 25
  | fortune      = 25
  | blast        = 100
  | blast        = 100
  | moneyMulti    = 50%
  | moneyMulti    = 50
  | xpMulti      = 100%
  | xpMulti      = 100
  | speed        = 120
  | speed        = 120
  | diggingPower  = 300
  | diggingPower  = 300
}}
}}
</pre>
<div class="mw-code"><nowiki>{{Item
</div>
| name          = Item Name
 
  | image         = File:Placeholder.png
== 🧪 Preview ==
  | lore          = Nothing.
 
  | type          = tool
<div style="background:#fff; border:1px solid #ccc; padding:10px; margin-bottom:1em;">
  | rarity        = epic
<!-- ✅ LIVE TEMPLATE RENDERING FROM A SEPARATE PAGE -->
  | magicFind    = 10
{{ItemPreviewExample}}
| fortune      = 25
</div>
| blast        = 100
<details>
| moneyMulti    = 50
<summary>📚 Advanced Info (Click to expand)</summary>
| xpMulti      = 100
 
| speed        = 120
=== 🛠️ Parameters ===
| diggingPower  = 300
 
}}</nowiki></div>
* '''name''' – Name of the item 
[[Category:Templates]]
* '''rarity''' – One of: `common`, `uncommon`, `rare`, `epic`, `legendary`, `exotic`, `admin`  
* '''image''' – Optional image (e.g. `File:Tool.png`)  
* '''magicFind''', '''fortune''', '''blast''' – Numerical stats  
* '''moneyMulti''', '''xpMulti''' – Multiplier stats (e.g. `50%`)  
* '''speed''', '''diggingPower''' – Numeric only  
 
=== 🎨 Rarity Colors ===
 
Rarity names link to the [[Rarity]] article:
 
* '''[[Rarity#Common|<span class="item-rarity-common">Common</span>]]'''
* '''[[Rarity#Uncommon|<span class="item-rarity-uncommon">Uncommon</span>]]'''
* '''[[Rarity#Rare|<span class="item-rarity-rare">Rare</span>]]'''
* '''[[Rarity#Epic|<span class="item-rarity-epic">Epic</span>]]'''
* '''[[Rarity#Legendary|<span class="item-rarity-legendary">Legendary</span>]]'''
* '''[[Rarity#Exotic|<span class="item-rarity-exotic">Exotic</span>]]'''
* '''[[Rarity#Admin|<span class="item-rarity-admin">Admin</span>]]'''
 
=== 💬 Tooltip Info ===
 
Each stat has a hover tooltip showing its purpose.
</details>
</noinclude>
</noinclude>


<includeonly>
<includeonly>
<!-- 🔧 Template:Item Display Code -->
<!-- Template:Item Display Code -->
 
<div class="infobox">
<style>
<div class="infobox-title item-rarity-{{{rarity|common}}}">'''{{{name|Unnamed Item}}}'''
.item-box {
</div>
  border: 1px solid #ccc;
<div class="image">
  padding: 10px;
[[{{{image|File:Placeholder.png}}}|200px|center]]
  background: #111;
</div>
  color: #fff;
<div class="item-lore">
  width: 300px;
{{{lore|}}}
  font-family: 'Minecraftia', monospace;
</div>
}
<!-- Info -->
.item-box img {
<div class="infobox-header"><div class="infobox-htxt">Information</div></div>
  max-width: 64px;
<div class="item-rarity item-rarity-{{{rarity|common}}}"><span class="infobox-label">Rarity:</span> {{ucfirst:{{{rarity|common}}}}}'''</div>
  float: right;
<div class="item-info"><span class="infobox-label">Type:</span> {{ucfirst:{{{type}}}}}</div>
  margin-left: 10px;
<!-- Stats -->
}
{{#iferror: {{#expr:{{{magicFind}}}{{{fortune}}}{{{blast}}}{{{moneyMulti}}}{{{xpMulti}}}{{{speed}}}{{{diggingPower}}}}}||{{#ifexpr:({{{magicFind|}}} + {{{fortune|}}} + {{{blast|}}} +
.item-name {
{{{moneyMulti|}}} + {{{xpMulti|}}} + {{{speed|}}} + {{{diggingPower|}}}) > 0|<div class="infobox-header"><div class="infobox-htxt">Statistics</div></div>}}}}
  font-size: 18px;
{{#iferror:{{#expr:{{{magicFind|}}} > 0}}|<div style= display:none></div>|<div class="item-stat"><span class="infobox-label">Magic Find:</span> {{{magicFind}}}</div>}}
  font-weight: bold;
{{#iferror: {{#expr:{{{fortune|}}} > 0}}|<div style= display:none></div>|<div class="item-stat"><span class="infobox-label">Fortune:</span> {{{fortune}}}</div>}}
}
{{#iferror:{{#expr:{{{blast|}}} > 0}}|<div style= display:none></div>| <div class="item-stat"><span class="infobox-label">Blast:</span> {{{blast}}}</div>}}
.item-rarity-common    { color: #FFFFFF; text-shadow: 0 0 2px #000; }
{{#iferror:{{#expr:{{{moneyMulti|}}} > 0}}|<div style= display:none></div>|<div class="item-stat"><span class="infobox-label">Money Multiplier:</span> +{{{moneyMulti}}}</div>}}
.item-rarity-uncommon  { color: #55FF55; text-shadow: 0 0 2px #000; }
{{#iferror:{{#expr:{{{xpMulti|}}} > 0}}|<div style= display:none></div>|<div class="item-stat"><span class="infobox-label">XP Multiplier:</span> +{{{xpMulti}}}</div>}}
.item-rarity-rare      { color: #5555FF; text-shadow: 0 0 2px #000; }
{{#iferror:{{#expr:{{{speed|}}} > 0}}|<div style= display:none></div>|<div class="item-stat"><span class="infobox-label">Speed:</span> {{{speed}}}</div>}}
.item-rarity-epic      { color: #FF55FF; text-shadow: 0 0 2px #000; }
{{#iferror:{{#expr:{{{diggingPower|}}} > 0}}|<div style= display:none></div>|<div class="item-stat"><span class="infobox-label">Digging Power:</span> {{{diggingPower}}}</div>}}
.item-rarity-legendary { color: #FFFF55; text-shadow: 0 0 2px #000; }
.item-rarity-exotic    { color: #55FFFF; text-shadow: 0 0 2px #000; }
.item-rarity-admin    { color: #FF5555; text-shadow: 0 0 2px #000; }
 
.item-stat {
  margin-top: 5px;
}
.item-stat-label {
  font-weight: bold;
  position: relative;
}
.item-stat-label .tooltip {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 3px 6px;
  border-radius: 4px;
  position: absolute;
  z-index: 1;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.item-stat-label:hover .tooltip {
  visibility: visible;
  opacity: 1;
}
</style>
 
<div class="item-box">
  {{#if: {{{image|}}} | [[{{{image}}}|frameless|link=]] }}
  <div class="item-name item-rarity-{{{rarity|common}}}">
    '''{{{name|Unnamed Item}}}'''
  </div>
  <div class="item-rarity item-rarity-{{{rarity|common}}}">
    '''[[Rarity#{{ucfirst:{{{rarity|common}}}}}|{{ucfirst:{{{rarity|common}}}}}]]'''
  </div>
 
  <!-- Stats -->
  {{#if:{{{magicFind|}}}|<div class="item-stat"><span class="item-stat-label">Magic Find<span class="tooltip">Increases chance for rare drops</span>:</span> {{{magicFind}}}</div>}}
  {{#if:{{{fortune|}}}|<div class="item-stat"><span class="item-stat-label">Fortune<span class="tooltip">Increases item yield</span>:</span> {{{fortune}}}</div>}}
  {{#if:{{{blast|}}}|<div class="item-stat"><span class="item-stat-label">Blast<span class="tooltip">Blast radius or power</span>:</span> {{{blast}}}</div>}}
  {{#if:{{{moneyMulti|}}}|<div class="item-stat"><span class="item-stat-label">Money Multiplier<span class="tooltip">Increases coin gain</span>:</span> +{{{moneyMulti}}}</div>}}
  {{#if:{{{xpMulti|}}}|<div class="item-stat"><span class="item-stat-label">XP Multiplier<span class="tooltip">Increases XP earned</span>:</span> +{{{xpMulti}}}</div>}}
  {{#if:{{{speed|}}}|<div class="item-stat"><span class="item-stat-label">Speed<span class="tooltip">Affects movement speed</span>:</span> {{{speed}}}</div>}}
  {{#if:{{{diggingPower|}}}|<div class="item-stat"><span class="item-stat-label">Digging Power<span class="tooltip">Blocks you can mine</span>:</span> {{{diggingPower}}}</div>}}
</div>
</div>
</includeonly>

Latest revision as of 20:01, 6 November 2025

Parameters

Caption text
Parameter Extra Information Required
(Y/N)
name The item's name (e.g. Iron Sword) Yes
image An image of the item Yes
lore Do "<br>" for new line No
rarity The item's rarity Yes
type The item's type (e.g. food, weapon) Yes
stats Use the stat as the parameter No

magicFind fortune blast income exp speed diggingPower

Example

Item Name

Nothing.

Information
Rarity: Epic
Type: Tool
Statistics
Magic Find: 10
Fortune: 25
Blast: 100
Money Multiplier: +50
XP Multiplier: +100
Speed: 120
Digging Power: 300
{{Item | name = Item Name | image = File:Placeholder.png | lore = Nothing. | type = tool | rarity = epic | magicFind = 10 | fortune = 25 | blast = 100 | moneyMulti = 50 | xpMulti = 100 | speed = 120 | diggingPower = 300 }}