Reagents

Overview

Reagents are items placed in the enchanting table's lapis slot that control which enchantments appear and how table power scales. Instead of only using vanilla Lapis Lazuli, you can define custom reagent items — such as MythicCrucible items or custom model data lapis — to gate specific enchantments behind specific reagent types.

Reagents require custom-table: true in config.yml to function.

How Reagents Work

  1. A player places an item in the enchanting table's lapis slot
  2. MythicEnchants resolves the item to a reagent key using a priority-based matcher
  3. The enchantment pool is filtered to only show enchantments that accept that reagent
  4. Table power equations may be overridden per-reagent to modify slot costs

Reagent items are consumed — they are read to determine which enchantments to offer, similar to how vanilla uses lapis.

Defining Reagents

Reagent files are loaded from:

  • plugins/MythicMobs/Packs/<pack>/Reagents/ (pack overlays, loaded second — can override base entries)

Each YAML file can declare multiple reagents as top-level keys. File names are cosmetic.

Structure

moondust:
  matches:
    mythiccrucible: moondust
    model-strings:
      - nexo:item/material/moondust
    legacy-model-data: 1042
  table-power:
    mode: override
    equations:
      slot1: "floor(min(count*1.5, 12))"
      slot2: null
      slot3: "floor(count*2)"
    slot-caps:
      slot1: 12
      slot3: 35
    max-base-level: 35

Matches Block

The matches: block defines how an item in the lapis slot is identified as this reagent.

Field Description
mythiccrucible MythicCrucible internal item name (also accepts mythic or crucible as the key)
model-strings List of custom model data strings to match (case-insensitive)
legacy-model-data Legacy integer custom model data value

Non-vanilla reagents must have at least one matcher. The vanilla key is reserved and never needs matchers.

Table Power Block

The optional table-power: block overrides global table power calculations for this reagent.

Field Description Default
mode override replaces global equations; additive adds to them
equations Per-slot math expressions (slot1, slot2, slot3). Use null to inherit global. Variable count is the power value
slot-caps Per-slot upper bounds applied after the equation
max-base-level Hard ceiling on the computed base level (overrides global)

Table Power Resolution Order

1. Compute global base value (global equation or vanilla formula)
2. Apply reagent override/additive:
   - OVERRIDE: replace with reagent equation (or keep global if null)
   - ADDITIVE: add reagent equation result to global
3. Apply cap: min(result, reagent cap or global cap)
4. Apply ceiling: min(result, reagent ceiling or global ceiling or 30)
5. Clamp to minimum of 1

Using Reagents in Enchantments

In an enchantment's Enchanting: block, the Reagent list controls which reagents unlock that enchantment at the table:

LunarLight:
  Enchanting:
    Weight: 5
    Reagent:
      - moondust
      - starshard

Special Values

Value Description
LAPIS_LAZULI Vanilla lapis with no metadata (also LAPIS or VANILLA)
ALL Enchantment appears for any reagent (also *)
(omitted) If Reagent is not specified, defaults to vanilla lapis only

Examples

# Only appears with moondust reagent
LunarEnchant:
  Enchanting:
    Weight: 10
    Reagent:
      - moondust

# Appears with any reagent
UniversalEnchant:
  Enchanting:
    Weight: 5
    Reagent:
      - ALL

# Appears with vanilla lapis or a specific custom item
HybridEnchant:
  Enchanting:
    Weight: 8
    Reagent:
      - LAPIS_LAZULI
      - starshard

# No Reagent field = vanilla lapis only (default behavior)
BasicEnchant:
  Enchanting:
    Weight: 15

Item Resolution Order

When a player places an item in the lapis slot, MythicEnchants resolves it to a reagent key using this priority:

Priority Method Example
1 Declared reagent matchers — checks mythiccrucible, model-strings, and legacy-model-data fields in order moondust (via Crucible internal name)
2 Plain vanilla lapisLAPIS_LAZULI material with no custom metadata vanilla
3 MythicCrucible API lookup — queries MythicBukkit for the item's internal name starshard
4 Custom model string — reads Paper's CustomModelDataComponent first string value nexo:item/material/gem

Vanilla Reagent Override

The reserved vanilla key lets you override table power for plain lapis without needing matchers:

vanilla:
  table-power:
    mode: additive
    equations:
      slot1: "1"
      slot2: "1"
      slot3: "1"

Supported Reagent Types

Type Description Matcher Field
Vanilla Lapis Lazuli Standard LAPIS_LAZULI material Automatic (keyword LAPIS_LAZULI)
MythicCrucible Items Items created by MythicCrucible mythiccrucible
Custom Model Data Strings Items with Paper CustomModelDataComponent strings model-strings
Legacy Custom Model Data Items with integer custom model data legacy-model-data

Config Settings

These settings in config.yml affect reagent behavior:

enchanting:
  custom-table: true              # Must be true for reagents to work
  assume-reagent-lapis: false     # false = wait for reagent in slot before showing offers
                                  # true = show vanilla-eligible offers even with empty slot
Updated Aug 19, 2026