MIRAWIKI
ESC
↑ ↓ NavigateEnter OpenESC Close

Enchantment Upgrades

/upgrade raises an enchantment on an enchanted item or book by one level, past the vanilla maximum: Sharpness V becomes Sharpness VI. Every level has a price in money, experience levels and items, set by the server. A clean money sink for a server's late game.

Commands #

Commands1
CommandSyntaxPermissionDefaultDescription
/upgrade/upgrade (alias /enchantupgrade, /upgradeenchant)upgrade.usetrueOpens the upgrade menu; the item goes into the menu's slot

How it works #

  1. Type /upgrade and put the enchanted item (or enchanted book) into the slot in the second row.
  2. The moment the item lands in the slot, the anvil at the bottom names the result in its description, such as "Sharpness V » Sharpness VI", and the fifth row lists what that level costs: money, levels and items, each next to what you currently have, green when fulfilled, red when not.
  3. The menu takes the item and shows a display in the slot: your item with every enchantment in its tooltip, the picked one purple with ▶ (such as "▶ Sharpness V » VI"). If the item has several upgradeable enchantments, a left click on the item picks the next one, a right click the previous one (a right click on the anvil steps forward as well). Shift click puts the item back into your inventory; with nothing to switch, a plain click does. The display is only a paper copy; your real item is never changed except by the upgrade itself.
  4. Once everything is green, left click the anvil. Money, levels and items are taken, the enchantment rises by one level, and the menu already shows the level after that.

When the menu closes or the connection drops, the item in the slot returns to your inventory (if that is full, it drops at your feet). If you die with the menu open, the item in the slot follows your inventory: with keepInventory (gamerule or plugin) it stays in the inventory, otherwise it is dropped like any other death drop (grave plugins see it). On /reload or restart an item in the slot is returned to the inventory. Requirement items are taken from the inventory, never from the off hand or the armour slots. Only one item at a time, never a stack.

Book or tool #

The configured prices are the prices of an enchanted book. Straight on an item (tool, weapon, armour) the same level costs more levels, because the book would still have to go through the anvil to get onto it:

  • Added is what the anvil would charge for exactly this book on exactly this item: the enchantment's anvil factor (halved for a book, at least 1) times its vanilla maximum, plus the item's prior work penalty, at most 39 levels (from 40 on the survival anvil says "Too Expensive!"). The anvil prices an upgraded book like a vanilla one: Sharpness VIII costs it as much as Sharpness V.
  • 3 levels come on top, so the shortcut is always a little dearer than book plus anvil.
  • The item's prior work penalty rises like after one anvil use (0, 1, 3, 7, ...), so later repairs get dearer just as on the book route.
  • Money and items stay the same.

Example: Sharpness VI costs 15 levels on a book. On a fresh sword it is 15 + 5 (anvil) + 3 = 23 levels, and the menu reads "Levels: 23 (15 + 8 for the item)". Thorns IV on a chestplate with prior work penalty 3: 20 + (4 × 3 + 3) + 3 = 38 levels.

If the price changes between drawing and the click (a config reload, say), nothing is taken and the menu redraws. Players with upgrade.free pay neither price nor surcharge and get no work penalty.

Higher levels in the anvil #

Upgraded levels survive the anvil: a book with Efficiency VII goes onto a pickaxe as usual, and repairing or combining keeps the higher level. Vanilla alone would clamp it back to the normal maximum. The anvil never goes above what went in; new levels only come from /upgrade.

A note on display: the game only has names for levels up to X. Above that the tooltip reads enchantment.level.11, which is why the default cap is 10. The menu and the messages write every level in roman numerals.

Shipped levels #

The file comes filled in: every vanilla enchantment whose effect keeps growing with the level is listed with fitting materials and rising prices, capped where the game stops adding anything or would break.

Enchantment6
EnchantmentVanillaHere up toExample materials
Sharpness, Smite, Bane of Arthropods, ImpalingVVIIIdiamonds and disc fragments; bones and skeleton skulls; spider eyes; prismarine
LootingIIIVwither skulls, emeralds, nether star
Efficiency, Power, DensityVVIIredstone and amethyst; spectral arrows and dragon breath; anvils and netherite
Protection, Fire, Blast, Projectile Protection, Feather Falling, Breach, PiercingIVVIobsidian, magma cream, TNT, arrows, feathers, breeze rods, depending on the type
Unbreaking, Fortune, Thorns, Respiration, Soul Speed, Swift Sneak, Sweeping Edge, Wind Burst, Loyalty, Riptide, Luck of the Sea, LungeIIIVmatching the enchantment, such as soul sand, echo shards, nautilus shells, copper and rabbit's feet
Knockback, Fire Aspect, Punch, Frost Walker, Quick Charge, LureII to IIIIVpistons and slime, blaze rods, packed ice, redstone, tropical fish

The spear enchantment Lunge is included: every level pushes you further forward on a jab and costs one more hunger point. Left out on purpose because a higher level does nothing or the enchantment only has level I: Mending, Infinity, Flame, Silk Touch, Channeling, Multishot, Aqua Affinity, Depth Strider (III already removes the slowdown) and the curses. Lure stops at IV because from V on fish stop biting, Quick Charge at IV because V would load in negative time.

Configuration #

File plugins/Mira/modules/upgrade.yml:

YAML
upgrade:
  # Highest level reachable here at all (hard cap 255).
  absolute-max-level: 10
  # Optional formula for levels WITHOUT an entry of their own, multiplied
  # by the level reached. Off by default: every enchantment prices its own levels.
  default-step:
    enabled: false
    money-per-level: 2500
    xp-levels-per-level: 8
    # Items for every default step, "MATERIAL:amount" or "nexo:<id>:amount".
    items: []
  # The prices below are the prices of an enchanted BOOK. Straight on an
  # item it costs more levels (see "Book or tool").
  item-surcharge:
    enabled: true
    # The anvil step of the book route: anvil factor (halved for a book,
    # at least 1) times the vanilla maximum plus the work penalty, at most 39.
    anvil-cost: true
    # Levels on top, so the shortcut is always a little dearer.
    extra-xp-levels: 3
    # Raises the item's prior work penalty like one anvil use (0, 1, 3, 7, ...).
    work-penalty: true
  # Which enchantments may be upgraded, by registry key, each with its own
  # prices. max-level caps the enchantment, steps price single target levels
  # with money, levels and up to FIVE different items. A level without a
  # step cannot be bought; an enchantment missing here can never be upgraded.
  enchantments:
    sharpness:
      max-level: 8
      steps:
        6:
          money: 5000
          xp-levels: 15
          items: ["DIAMOND:10"]
        7:
          money: 12000
          xp-levels: 25
          items: ["DIAMOND:20", "DISC_FRAGMENT_5:3"]
        8:
          money: 30000
          xp-levels: 35
          items: ["NETHER_STAR:1"]
    protection:
      max-level: 6
      steps:
        5:
          money: 6000
          xp-levels: 20
          items: ["DIAMOND:12", "OBSIDIAN:32"]
        6:
          money: 15000
          xp-levels: 30
          items: ["NETHERITE_SCRAP:4", "TOTEM_OF_UNDYING:1"]

cooldown:
  # Seconds between two menu openings per player, 0 disables.
  commands:
    upgrade: 0

Items are written as MATERIAL:amount, for example NETHER_STAR:3, at most five different ones per level (with money and levels that fills the menu row). With Nexo, custom items work as nexo:<id>:amount. A vanilla requirement cannot be paid with a Nexo item of the same material and the other way round. Only plain items pay: renamed, enchanted or damaged ones stay in the inventory. A broken entry is reported once in the console and shown in the menu as a red line nobody can fulfil; the step stays locked until the entry is fixed instead of quietly getting cheaper.

Money needs the economy module. With it off, levels that ask for money cannot be fulfilled.

Permissions #

Permissions2
PermissionDefaultDescription
upgrade.usetrueOpen /upgrade and upgrade enchantments against the configured price
upgrade.freeopUpgrade without money, levels or items and without work penalty; the requirements stay visible but count as fulfilled