Template:Item: Difference between revisions

From StrawberryMC
CmdBlock00 (talk | contribs)
Created page with "{| style="float:right; border:3px solid pink; background: solid purple; border-radius: 5px; width:270px" !colspan="2"; display: block; | Fantastic Page |- !colspan="2" | 260px |- ! Info | Stuff |- ! More Info | |- ! And Info | Again Stuff |}"
 
Starting to setup the template pages
Line 1: Line 1:
{| style="float:right; border:3px solid pink; background: solid purple; border-radius: 5px; width:270px"
<noinclude>
!colspan="2"; display: block; | Fantastic Page
== 🎒 How to Use This Template ==
|-
 
!colspan="2" | [[File:Example image.svg|260px]]
<div style="background:#f4f4f4; border:1px solid #ccc; padding:10px; margin-bottom:1em;">
|-
📋 Just copy and paste this example and edit the values:
! Info
 
| Stuff
<pre>
|-
{{Item
! More Info
| name          = Shadow Pickaxe
|  
| rarity        = epic
|-
| image        = File:ShadowPickaxe.png
! And Info
| magicFind    = 10%
| Again Stuff
| fortune      = 25
|}
| blast        = 100
| moneyMulti    = 50%
| xpMulti      = 100%
| speed        = 120
| diggingPower  = 300
}}
</pre>
</div>
 
== 🧪 Preview ==
 
<div style="background:#fff; border:1px solid #ccc; padding:10px; margin-bottom:1em;">
<!-- ✅ LIVE TEMPLATE RENDERING FROM A SEPARATE PAGE -->
{{ItemPreviewExample}}
</div>
<details>
<summary>📚 Advanced Info (Click to expand)</summary>
 
=== 🛠️ Parameters ===
 
* '''name''' – Name of the item 
* '''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>
 
<includeonly>
<!-- 🔧 Template:Item Display Code -->
 
<style>
.item-box {
  border: 1px solid #ccc;
  padding: 10px;
  background: #111;
  color: #fff;
  width: 300px;
  font-family: 'Minecraftia', monospace;
}
.item-box img {
  max-width: 64px;
  float: right;
  margin-left: 10px;
}
.item-name {
  font-size: 18px;
  font-weight: bold;
}
.item-rarity-common    { color: #FFFFFF; text-shadow: 0 0 2px #000; }
.item-rarity-uncommon  { color: #55FF55; text-shadow: 0 0 2px #000; }
.item-rarity-rare      { color: #5555FF; text-shadow: 0 0 2px #000; }
.item-rarity-epic      { color: #FF55FF; text-shadow: 0 0 2px #000; }
.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>
</includeonly>

Revision as of 06:33, 12 October 2025

🎒 How to Use This Template

📋 Just copy and paste this example and edit the values:

{{Item
 | name          = Shadow Pickaxe
 | rarity        = epic
 | image         = File:ShadowPickaxe.png
 | magicFind     = 10%
 | fortune       = 25
 | blast         = 100
 | moneyMulti    = 50%
 | xpMulti       = 100%
 | speed         = 120
 | diggingPower  = 300
}}

🧪 Preview

<details> <summary>📚 Advanced Info (Click to expand)</summary>

🛠️ Parameters

  • name – Name of the item
  • 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:

💬 Tooltip Info

Each stat has a hover tooltip showing its purpose. </details>