# Rarities A rarity is a category for enchantments: *Common*, *Rare*, *Legendary*, *Curse*... It gives its enchantments a **color** for their name and a set of **default numbers**, so you do not have to repeat them in every file. Rarities live in `plugins/MetaEnchants/rarities.yml`. Most changes to rarities need a **server restart**; `book`, `minimum-table-level` and the [chances](Where-Enchantments-Appear#chances) in `obtain` reload with `/metaenchants reload`. If neither the rarity nor the enchantment writes `fishing`, it follows the final `loot` value after merging. ```yaml rarities: common: name: "Common" color: "" weight: 10 anvil-cost: 1 min-cost: { base: 1, per-level: 10 } max-cost: { base: 21, per-level: 10 } obtain: { enchanting-table: true, villagers: true, loot: true, fishing: true, mob-equipment: true, traded-equipment: true } legendary: name: "Legendary" color: "" weight: 1 anvil-cost: 8 min-cost: { base: 25, per-level: 25 } max-cost: { base: 75, per-level: 25 } treasure: true obtain: { enchanting-table: false, villagers: 50%, loot: true, fishing: true, mob-equipment: false, traded-equipment: false } book: item: material: ENCHANTED_BOOK rarity: EPIC ``` The id of a rarity (`common`, `legendary`) is what you write in an enchantment's `rarity` option. Menus list the last rarity written first, so the rarest ones usually appear first; `/metaenchants list` follows the order of the file. ## The options of a rarity | Option | Meaning | |---|---| | `name` | The visible name, like `"Legendary"`. | | `color` | The color tag applied to the names of its enchantments, like `""` or `"<#ff8800>"`. See [Text and Colors](../Text-And-Colors). | | `weight` | The default [weight](Where-Enchantments-Appear#weight) (1 to 1024). | | `anvil-cost` | The default [anvil cost](Creating-An-Enchantment#anvil-cost). | | `min-cost`, `max-cost` | The default [table costs](Where-Enchantments-Appear#min-cost-and-max-cost). | | `obtain` | Where its enchantments appear by default: `true`, `false` or a chance like `50%`. See [Where Enchantments Appear](Where-Enchantments-Appear). | | `treasure` | `true` makes its enchantments treasure by default: never in the table, double price in trades. | | `minimum-table-level` | The enchanting table only gives its enchantments from this level cost. See [Minimum table level](Where-Enchantments-Appear#minimum-table-level). | | `book` | How the books of its enchantments look and behave. See [Enchanted Books](Books). | Every option is optional, and every enchantment can override any of them with its own value. ## The rarities that come with the plugin | Id | Name | Color | Weight | Treasure | Typical use | |---|---|---|---|---|---| | `common` | Common | white | 10 | no | Everyday enchantments. Found everywhere. | | `uncommon` | Uncommon | green | 5 | no | | | `rare` | Rare | aqua | 2 | no | Not on mobs' equipment. | | `epic` | Epic | light purple | 1 | no | Very uncommon. Not on mobs' or traded equipment. | | `legendary` | Legendary | gold | 1 | **yes** | Only in villagers (half of the times), loot and fishing. Its books have a purple name. | | `curse` | Curse | red | 1 | **yes** | Only in villagers, loot and fishing. | (You can rename them if you like, as long as every enchantment uses an id that exists.) ## Tips - Create a rarity for each "tier" of your server, and set the `obtain`, weight and costs once there. - If you write a `rarity` in an enchantment that does not exist, the console tells you and suggests the closest one. - If `rarities.yml` is missing or empty, the plugin uses a single `common` rarity so it keeps working.