Item Rarity
A rarity is a category you attach to items to show how good or rare they are: each rarity adds a lore tag, has a weight that breaks ties, and can claim a list of items. This page covers creating a rarity and turning the system on.
Quick start
Enable the rarity system: set
rarity.enabled: truein/plugins/EcoItems/config.yml(see Plugin Config).Open the
/plugins/EcoItems/rarities/folder.Copy
_example.ymland rename it to your rarity's ID, e.g.legendary.yml.Set the
lore,weight, and anyitemsthe rarity should apply to.Run
/ecoitems reload.Give yourself an item using that rarity and confirm the rarity lore tag appears.
Naming and IDs
The file name without .yml is the rarity's ID. That ID is what you put in an item's rarity: field and in the Item Lookup System, so legendary.yml has the ID legendary.
The structure of a rarity
| Part | What it controls |
|---|---|
| Lore | The lore tag added to items of this rarity |
| Weight | Which rarity wins when an item matches more than one |
| Items | The non-EcoItems items that should get this rarity |
# === Lore: the tag shown on the item ===
lore:
- "&a&lCOMMON" # One lore line per entry, added to the item
# === Weight: tie-breaking ===
weight: 1 # Higher weight wins when an item matches multiple rarities
# === Items: what gets this rarity ===
items: # Items from the Item Lookup System; EcoItems should set rarity in their own config instead
- diamond
Lore
The lore list is the tag appended to every item of this rarity. Each entry is one line of lore and supports colour codes.
lore:
- "&a&lCOMMON" # One lore line per entry, added to the item
Weight
An item can match more than one rarity. weight decides which one is shown: the highest weight wins.
weight: 1 # Higher weight wins when an item matches multiple rarities
Items
The items list assigns this rarity to vanilla or other looked-up items. EcoItems should set their rarity in their own config with the rarity: field rather than being listed here.
items: # Items from the Item Lookup System
- diamond
Where to go next
Plugin settings: Plugin Config for the global rarity options like the default rarity.
Make an item: How to make an Item to set a
rarity:on your own items.