AI Agent Skill
On this page(4)
Enchants are a large, exact format: 26 action types, positions, expressions and menu tiles. An AI agent writes them well only when it knows every key and rule. This page gives you a skill: one file that teaches an agent the whole format, the workflow, balanced defaults and a self-check. The agent then delivers a working enchant and its menu tiles on the first try.
What the agent delivers
Ask for an enchant in plain words. The agent answers with:
- The full enchant file,
modules/sword/enchants/<id>.yml. - The menu edits: the layout letter and the five tiles for
enchants-2.ymlandupgrade.yml. - The test commands (
/dungeons reload,testenchant). - The assumptions it made (currency, numbers) and a balancing note.
When the agent can read your server files, it checks them before it writes. It looks at your currencies, enchants, presets, zone rarities and free menu letters.
Install it
The skill is the file at the bottom of this page. Copy it whole, from --- to the last line.
| Agent | Where to put it |
|---|---|
| Claude Code | Save it as .claude/skills/sndungeons-enchants/SKILL.md inside the folder you open (for example your server folder), or in ~/.claude/skills/sndungeons-enchants/SKILL.md for every project. It loads by itself when you ask for an enchant |
| Claude apps (claude.ai, desktop) | Put SKILL.md in a folder named sndungeons-enchants, zip the folder, and upload it as a skill in the settings. Or add the file to a Project's knowledge |
| Any other agent or chat | Add the file as project knowledge, a rules or instructions file, or paste it as the first message of the chat |
Give the agent access to your plugins/SnDungeons/ folder when you can (a local copy of the server
files works). It then reads modules/sword/enchants/example.yml, the reference of your installed
version, and writes the files in place.
Use it
Describe the enchant like you would to a developer. A few examples:
Make an enchant "Meteor": a rare meteor falls on my target and hits every mob within 6 blocks.
Bought with souls, max level 2500, it should feel like an ultimate.Create a kill-trigger enchant that gives money and, from level 500, a 10 second damage buff.My enchant frost-nova.yml prints "actions[3].amount ... unknown variable {dmg}". Fix it.Balance these three enchants against each other: lightning, frost-nova, meteor.After the agent answers:
- Save the files it gave you (or let it write them).
- Run
/dungeons reloadand check that the console prints no warning. - Run
/dungeons admin sword testenchant <you> <id> <level>and swing at a zone mob. - Give yourself levels with
/dungeons admin sword enchant <you> <id> <levels>and check the tiles.
An agent can still make mistakes. Always reload and test before players get the enchant. When the console prints a warning, paste it back to the agent: the skill tells it how to read and fix one.
The skill file
sndungeons-enchants/SKILL.md
---
name: sndungeons-enchants
description: Create, edit, balance and debug SWORD ENCHANTS for the SnDungeons Minecraft plugin (Paper). Use whenever the user asks for a new SnDungeons enchant, wants to change or fix an existing one (console warnings included), wants enchant ideas, or needs an enchant's tiles in the enchants and upgrade menus. Covers the enchant YAML of modules/sword/enchants/<id>.yml, presets, the second-hand and momentum modes, limits, pricing, prestige and the menu tiles.
---
# SnDungeons sword enchants
You write sword enchants for SnDungeons. An enchant is ONE YAML file in
`plugins/SnDungeons/modules/sword/enchants/<id>.yml`. While a player fights their zone mobs, every
enchant they have a level in may proc on a sword swing and run its `actions:` list. There is no
code: only the keys of this reference. The plugin compiles the file on `/dungeons reload`.
Your deliverable is always: (1) the enchant file, (2) its menu tiles, (3) the test commands.
## Workflow
1. **Understand the request.** Theme and look, the effect (damage, area, chain, rain, buff,
reward, fighters...), when it procs (`swing` or `kill`), how rare it should feel, the currency
that buys it and the max level. If an essential is missing, ask ONE short question with
suggested defaults; otherwise choose defaults and state them.
2. **Read the server when you can.** If you have the server files:
- `modules/sword/enchants/example.yml` documents every key of the INSTALLED version. If it
disagrees with this skill, the file wins.
- `currencies/*.yml`: the valid currency ids for `cost.currency` and `give-currency`.
- `modules/sword/enchants/`: the existing ids (never reuse one; `proc-enchants` names them).
- `modules/sword/presets/`: the presets you may call and their `params:`.
- `modules/zones/config.yml` `mobs.rarities`: the rarity ids for `set-rarity`.
- `modules/sword/guis/enchants*.yml`: the free layout letters.
3. **Design** with the patterns below. Prefer shipped presets over copying their actions.
4. **Write the enchant file** with only the keys of this reference.
5. **Write the tiles**: three list tiles and two upgrade info tiles (templates below).
6. **Self-check** with the checklist at the end. Fix before you answer.
7. **Hand over**: the file paths, the full YAML, what to edit in the menus, then the test commands.
## Hard rules
- Use ONLY keys listed here. An unknown action key is ignored WITHOUT a warning, so a typo silently
does nothing.
- The id = the file name: lowercase `a-z`, `0-9`, `-`, at most 56 characters, `.yml`. Never name a
file `example.yml` (that file is never loaded).
- Quote every expression, position, color and text: `'{damage} * 2'`, `'{target_pos}'`, `'#FF5555'`,
`'&c&lCRIT!'`. An unquoted `{...}` is a YAML map and breaks the file.
- Root keys (`max-level`, `chance`, `cooldown-ticks`, `cost`) take PLAIN numbers, never expressions.
- Also plain numbers: `fade-in`, `stay`, `fade-out`, `size`, `weight`, every `animation` value and
ticks, `add-booster` `max-multiplier` and `time`, item-map `amount` and `custom-model-data`, and
every `follow:`, `dash:` (except `dash.damage`) and `momentum:` value.
- No math inside braces in a text: `{level*2}` stays as written. Compute through a preset NUMBER
param, then print `{param}` or `{param_formatted}`.
- `area.max-mobs` defaults to 1. Write it every time (`1000` = every mob in the radius).
- An `entity` never makes the list wait. To land a hit with a falling or jumping entity, put a
`delay` equal to its flight before the `damage` (inside a `parallel` when in a loop).
- Effect entities are visual only: they never damage. Damage comes from `damage` actions or an
`attack:` block.
- `glow` takes a color name, never `true`.
- `{mob_pos}`, `{from_pos}`, `{to_pos}`, `{point_pos}` only inside their flow.
- Write modern Minecraft names (Paper 1.20.5+): `DUST`, `ENTITY_EFFECT`, `FIREWORK`, `WITCH`, `POOF`.
The plugin maps them on 1.20.4. Avoid particles, sounds and mobs newer than the server version.
- `add-booster` with `persistent: true` writes the database on EVERY proc: only with a low chance
or a cooldown.
- A new enchant file does NOT add itself to the menus: always deliver its tiles.
- Never use an em dash or en dash in texts; use a hyphen.
## How a proc works
On every automatic sword swing on a zone mob: the `swing` enchants roll (in id order), then, if the
swing killed, the `kill` enchants. A roll needs level >= 1, the cooldown over, and wins with:
`chance at level x (1 + power-per-star x stars) x enchant chance boosters`, capped at 100%. A won
roll needs a free sequence slot (`enchants.max-sequences`, 8), starts the cooldown, then runs the
actions top to bottom. Enchant hits are NEVER swings: they never proc enchants (except the
`proc-enchants` action and a second hand's dash, one level deep). Only the owner sees and hears
the effects (and visitors of their fight, for visuals). Damage, kills, rewards and boosters are real.
AFK clones and heroes may roll the owner's enchants at a reduced chance; those procs pay but never
count for progress.
## Root keys
| Key | Default | Rules |
|-----|---------|-------|
| `display-name` | the id | Colors allowed. Shown in messages, menus, `{enchant}` |
| `icon` | `ENCHANTED_BOOK` | A material or `texture-<base64>`. Checked, not shown by menus |
| `description` | none | List of lines or one text. `%sndungeons_enchant_<id>_description%` |
| `max-level` | 1 (warning) | Whole number 1 to 1000000. ALWAYS write it |
| `chance` | 100 (warning) | Percent 0 to 100: `5`, or `{ min: 1, max: 25 }` (min at level 1, max at max-level, linear). ALWAYS write it |
| `trigger` | `swing` | `swing` (every swing, the killing one too) or `kill` (a swing that killed) |
| `cooldown-ticks` | 0 | 0 to 72000, per player (20 = 1 s) |
| `mode` | `normal` | `normal`, `second-hand`, `momentum` |
| `cost` | unbuyable | `{ currency, starting-cost, increase-cost-by, exponential-growth, is-exponential }` |
| `prestige` | global | Optional overrides: `max-stars`, `cost-multiplier`, `power-per-star`, `price: { currency, base, growth }` |
| `actions` | none | The list a proc runs |
`cost`: level L to L+1 (L from 0) costs `starting-cost + increase-cost-by x L` (linear, default) or
`starting-cost x exponential-growth ^ L` with `is-exponential: true`. Defaults: `currency: ''`
(unbuyable), `starting-cost: 100` (above 0; accepts `'1.5K'`, `'2e5'`), `increase-cost-by: 0`,
`exponential-growth: 1.15` (>= 1). Exponential explodes at high levels: use it only for short
enchants or a growth of 1.01 to 1.05.
Prestige (global defaults in `modules/sword/config.yml` `enchants.prestige`: `max-stars: 10`,
`cost-multiplier: 3`, `power-per-star: 0.04`, `price.currency: ''` free): at max level a prestige
resets to level 0 with one more star; chance x (1 + power x stars); level prices x cost-multiplier ^
stars; prestige price `base x growth ^ (stars before)`. `max-stars: 0` = no prestige.
## Expressions (every number of an action)
Operators `+ - * / % ^ ( )`, comparisons `== != < <= > >=` (1 or 0), `&& || !`. Functions:
`min(a,b,...)`, `max(a,b,...)`, `floor`, `ceil`, `round`, `abs`, `sqrt`, `log10`, `pow(a,b)`,
`clamp(x,low,high)`. A non-finite result (division by 0) makes that action do nothing.
| Variable | Value | Valid |
|----------|-------|-------|
| `{level}` / `{max_level}` | Player's level / the max-level | everywhere |
| `{damage}` | Damage of the swing that procced: sword damage x damage boosters, before debuffs | everywhere |
| `{prestige}` / `{prestige_power}` / `{max_prestige}` | Stars / 1 + power x stars / max-stars | everywhere |
| `{random:a:b}` | New uniform number in [a, b) on each read; a, b plain numbers | everywhere |
| `{i}` | Round of the innermost loop, from 0 | loop |
| `{mob_health}` / `{mob_health_percent}` | The round's mob health / 0 to 100 | for-each-mob |
| `{jump}` | Chain jump, from 1 | chain |
| `{point_index}` / `{point_count}` | Point from 0 / points in the path | for-each-point |
| `{debuff_stacks}` / `{debuff_percent}` | Most charges on one mob after the last debuff / x its percent | after a debuff |
| `{<param>}` | A NUMBER param | inside a preset |
Outside its flow a flow variable is 0. A PlaceholderAPI number works: `'%player_level% / 10'`
(letters, digits, `_ : - .`; not a number = the action does nothing). Whole numbers from 1 to 6:
`floor({random:1:7})`.
Texts (`message`, `actionbar`, `title`, `subtitle`, text display, mob/npc `name`): `&` colors, hex
`&#RRGGBB`, MiniMessage tags, `%placeholders%`, `{player}`, `{enchant}`, `{enchant_id}`, every number
variable (whole = no decimals, else up to 2), `{<var>_formatted}` (1.5K style). In a text `{level}`
shows the max label at max level (`{level_formatted}` stays a number).
## Positions
Anchors (always quoted): `{target_pos}` (feet of the mob that procced, fixed at the proc),
`{player_pos}` (your feet now), `{mob_pos}` (for-each-mob round), `{from_pos}` / `{to_pos}` (chain
jump start / landing), `{point_pos}` (for-each-point round). Body forms (not for `{point_pos}` nor the area anchors): replace `_pos` with
`_center` (middle of the body) or `_top` (top of the head): `{target_center}`, `{mob_top}`,
`{to_center}`, `{player_center}`. Area anchors (the player's mob area, read once at the proc):
`{area_center}`, `{area_min}` (floor), `{area_max}` (top corner), `{random_in_area}` (a random
floor column each time). No area = the action does nothing. `offset: 'x, y, z'` (expressions) or
`{ x, y, z }`; world axes (x east, y up, z south). A particle `to`, a for-each-point `to` and a
damage `at` take no offset. An area hit puts `offset` inside `area`, jump-to inside `movement`, a mob
search inside `mobs`.
## Actions
Every action is a map with `type` (or `preset:`). EVERY action takes `chance` (percent, expression)
and `requirement` (expression, runs when not 0). On a container (loop, random, parallel, flows,
preset line) the guard covers everything inside. Nesting up to 32 deep; at most 10000 actions per
enchant with presets expanded.
### damage
`amount` (required, > 0). Single hit (no `area`): `at` (`{target_pos}` default; `{mob_pos}`,
`{to_pos}`, `{from_pos}` in flows; no offset; dead mob = nothing), `spread: { mobs [1] (1-1000),
radius [3], percent [50] }` (the hit mob takes all, up to `mobs` OTHER mobs near it take percent).
Area hit: `area: { center [{target_pos}], offset, radius (required, > 0), max-mobs [1] (1-1000) }`,
nearest first; `at` and `spread` ignored. Both: `execute-below: <percent>` (a mob left alive below it
dies; 100 = instant kill; a normal death that pays). Kills pay stage rewards. Fixed amounts are not
boosted; `{damage}` is. Debuffs add on top.
### give-currency
`currency` (required, a currency id), `amount` (required, > 0). Multiplied by the player's booster
of that currency. Logged as `enchant:<id>`.
### message / actionbar
`message` (required; `text` accepted).
### title
`title ['']`, `subtitle ['']`, `fade-in [10]`, `stay [40]`, `fade-out [10]` (ticks 0-1200, plain).
### sound
`sound` (required: `ENTITY_PLAYER_LEVELUP`, `minecraft:entity.player.levelup` or `pack:custom.id`),
`volume [1]`, `pitch [1]` (expressions; client plays 0.5-2), `at [{player_pos}]`, `offset`,
`category [MASTER]` (MASTER, MUSIC, RECORDS, WEATHER, BLOCKS, HOSTILE, NEUTRAL, PLAYERS, AMBIENT,
VOICE, UI).
### particle
`particle` (required), `shape [point]`, `at [{target_pos}]`, `offset`, `to [{player_pos}]`,
`radius [1]`, `height [2]`, `turns [2]`, `start-angle [0]`, `end-angle [180]` (0 east, 90 south,
180 west, 270 north), `sides [6]`, `points [5]`, `inner-radius [0.4 x radius]`, `tilt [0]` (0 flat,
90 upright; circle, arc, polygon, star, spiral), `count` (point 10 particles, shapes 20 points;
1-1000), `spread ['0, 0, 0']`, `speed [0]`.
Shapes: `point`, `circle`, `sphere`, `line` (at to to), `helix` (radius, height, turns),
`rectangle` (flat outline between at and to), `area-border` (mob area border at the height of at),
`arc`, `cone` (base radius at at, tip height above), `polygon`, `star`, `spiral` (flat, out to radius).
Data: `DUST` needs `color: '#RRGGBB'` and optional `size` (plain, default 1); `ENTITY_EFFECT`,
`TINTED_LEAVES` need `color` (on Paper 1.20.4 `ENTITY_EFFECT` ignores it); `BLOCK`, `FALLING_DUST`, `DUST_PILLAR`, `BLOCK_CRUMBLE`, `BLOCK_MARKER`
need `material:` a block; `ITEM` needs `material:` an item. Not supported: `DUST_COLOR_TRANSITION`,
`VIBRATION`, `SCULK_CHARGE`, `SHRIEK`, `TRAIL`. Cap: 300 particles per player per tick.
### entity
Exactly one of `entity: <MOB>` (living EntityType, not PLAYER or ENDER_DRAGON) or `display:`
with exactly one of `item: <MATERIAL>` | `item: sword` (copy of the player's sword) | `item: { item
map }` | `block: <MATERIAL>` | `text: '<text>'`, plus `billboard [center]` (fixed, vertical,
horizontal, center). Keys: `at [{target_pos}]`, `offset`, `lifetime [40]` (1-600 ticks),
`movement: { type [none], speed [0.1] (0-4), radius [1.5] (0-16), to [{target_pos}], height [1]
(0-64), offset }` with type `none`, `rise`, `fall`, `orbit`, `to-target` (flies to the proc mob at
aim height), `jump-to` (arc to `to` over its lifetime, lands on its last move), `glow` (black,
dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua,
red, light_purple, yellow, white; mobs and item/block displays only), `scale [1]` (mob 0.0625-16,
display 0.01-64), `name` (mobs), `animation`, `equipment` (mobs), `attack` (mobs, see npc),
`model`. Hitting one does nothing. Caps: 32 alive, 8 new per tick, per player.
Fall timing: a display falling from height H at speed S lands in H / S ticks; use `lifetime` = that
+ 2 and a `delay` of that before the hit.
Block displays draw from the block corner: offset -0.5 on x and z to center.
`animation`: tracks `color`, `scale`, `rotation`, each a list of `{ value, ticks }` (plain values,
ticks 0-100, max 64 steps), plus `loop [false]`. color `'#RRGGBB'` changes at its step start (text
display text, or the glow of an item/block display or mob that has `glow:`); scale reached over
ticks from `scale`; rotation `'yaw pitch roll'` (-36000 to 36000) reached over ticks from `'0 0 0'`
(`'0 0 360'` = full turn; use `billboard: fixed` on displays). On a mob, yaw/pitch add to its facing
(appears facing south; 0 south, 90 west, 180 north, -90 east), no roll, never with `attack`.
`equipment`: `copy-player`, or slots (any case) `head|helmet`, `chest|chestplate`,
`legs|leggings`, `feet|boots`, `hand|main-hand|mainhand`, `off-hand|offhand`, `body` (horse, wolf,
llama armor; Paper 1.20.5+), `saddle` (Paper 1.21.5+); each a material, `sword`, `copy-player`, or an item map: `material`
(required), `amount` (1-99), `glint`, `custom-model-data`, `item-model` (`ns:path`), `color`
(`'#RRGGBB'` or `'r,g,b'`), `texture` (head base64), `skull-owner`, `name`, `trim: { pattern,
material }`.
`model`: `'paper:1001'` (custom model data), `'paper:ns:model'` (item model), `'bm:<id>'`
(BetterModel), `'meg:<id>'` (ModelEngine), or a block with `item: { material, custom-model-data,
item-model, display-context, translation, rotation, billboard, glint }`, `scale`, `height`,
`hitbox-scale`, `yaw-offset`, `render (default|packet|entity)`, `animations (idle, walk, attack,
hurt, death, spawn)`. Missing engine = vanilla look.
### lightning
`at [{target_pos}]`, `offset`. Visual and thunder only, 20 ticks, no damage.
### npc (fake players)
`count [1]` (1-16), `at [around-player]` (around-player, around-target, random-mobs), `skin
[player]` (`player`, `{ player: <name> }`, `{ texture, signature }`), `equipment`, `lifetime [160]`
(1-600), `attack`, `animation` (rotation and scale only), `model`. Cap: 6 alive per player.
`attack` (npc and entity mobs): `damage` (required, read ONCE at spawn), `per-second [1]` (0.1-10),
`target [nearest]` (nearest, target, random, farthest, lowest-health, highest-health,
lowest-health-percent, highest-health-percent), `move [walk]` (walk, teleport), `speed [0.3]`
(0.05-2), `radius [12]` (1-64). Hits within 1.8 blocks; its hits never proc enchants; silent. A fighter appears facing its first
mob; an npc without attack faces the player.
### delay
`ticks` (required, 1-1200).
### loop
`times` (required, 0-1000, read once), `every [0]` (ticks between rounds, 0-1200), `actions`
(required). `{i}` from 0; inner loops hide the outer `{i}`. The list after a loop (and after a
random or a flow) waits until its last round ended; a `delay` in a round holds the next round.
### random
`entries` (required): list of `{ weight [1] (plain > 0), actions }`; runs ONE entry. Entries take
no guard; put it on the `random` line.
### parallel
`actions` (required): a branch that starts now; the actions after it do NOT wait for it. Copies
variables and flow positions. At most 16 alive branches per proc. Shares the proc's sequence slot.
### preset (line)
`preset: <id>`, `with: { <param>: <value> }` (missing = default). Takes the guard.
### for-each-mob
`mobs` (selector, missing = every alive mob), `every [0]` (ticks between mobs), `actions`
(required). Selection made once at the start; dead mobs skipped. Inside `{mob_pos}`,
`{mob_health}`, `{mob_health_percent}`.
Selector `mobs: { from [{target_pos}], offset, radius [none = all], min-radius [none], max [1000]
(1-1000 or all), order [nearest], exclude-target [false] }`; orders `nearest`, `farthest`, `random`,
`lowest-health`, `highest-health`, `lowest-health-percent`, `highest-health-percent`.
### chain
`start [target]` (target, player), `jumps` (required, 0-1000), `radius [6]`, `delay-ticks [0]`,
`actions` (required). Each jump lands on the nearest unvisited alive mob within radius; stops when
none. Inside `{from_pos}`, `{to_pos}`, `{jump}` (from 1).
### for-each-point
`points: { path (required), count [8] (1-1000), radius [3], from [{target_pos}], offset, to
[{player_pos}], y-offset [0], order [clockwise] (clockwise, counter-clockwise, random), start
[north-west] (north-west, north-east, south-east, south-west) }`, `every [0]`, `actions`
(required). Paths: `area-border`, `area-corners` (4), `circle` (around from), `line` (from to to),
`grid` (cells over the area), `random-in-area`. Area paths sit on the area floor + y-offset.
Inside `{point_pos}`, `{point_index}`, `{point_count}`.
### set-rarity
Exactly one of `rarity: <id>` (of `mobs.rarities`) or `up: <n>` (-100 to 100, along the written
order; shipped common, rare, epic, legendary, boss). Mobs: `mobs:` selector, or `at
[{target_pos}]`. Changes name prefix, glow, max health (same share), rewards on death.
### debuff
`percent` (required, > 0, max 1000, extra damage taken per charge from every source), `duration`
(required, ticks, max 72000), `id [enchant id]` (`a-z0-9_-`; same id stacks, different ids add),
`max-stacks [1]` (1-64), `refresh [all]` (all = each new charge restarts all; added = each keeps
its own). Mobs: `mobs:` or `at`. Then `{debuff_stacks}` and `{debuff_percent}`.
### spawn-mobs
`count` (required, 1-50): the zone NPC throws extra mobs of the stage (cap `mobs.max-extra-mobs`, 20).
### play-animation
`animation` (required, the engine model's animation name); `mobs:` or `at`. Engine models only.
### add-booster
`id` (required; `a-z0-9_.:-`, 1-64; pastes `{player}`, `{enchant_id}`, `{level}`, number variables),
`name [display-name]`, `target` (required: damage, swings, enchants, enchant:<id>, luck,
currency:<id> or a currency id), `multiplier` (required expression; additive = bonus, 1 = +1;
multiplicative = factor), `stacking [additive]` (additive, multiplicative), `time [0]` (`30s`, `5m`,
`1h`, `1d`, seconds; 0 = for good), `persistent [false]`, `if-exists [replace]` (replace, keep,
extend, stack), `max-multiplier [0]` (0 = no limit). Total of a target = (1 + additive bonuses) x
(sum of multiplicative factors or 1).
### remove-booster
`id` (required, same variables).
### potion
`effect` (required: speed, jump_boost, night_vision, regeneration, resistance, haste,
slow_falling...), `amplifier [0]` (0 = I; expression, 0-255), `duration` (required, ticks,
expression, 1-6000), `particles [true]`, `icon [true]`, `ambient [false]`. Only while the player is
in their zone; removed when they leave. Strength and weakness do nothing to zone mobs.
### proc-enchants
`mode [blacklist]` (blacklist, whitelist), `enchants` (ids), `trigger [swing]` (swing, kill, both),
`damage ['{damage}']`. One extra swing on the flow's mob (else the proc mob). Never procs itself, a
second hand, or an enchant with its own proc-enchants.
## Presets
A preset file `modules/sword/presets/<id>.yml` (id up to 64 chars) has `params:` (defaults) and
`actions:`. A param whose value is a math expression is a NUMBER (re-read on each use; works in
expressions and as `{p}`/`{p_formatted}` in texts); anything else is TEXT (pasted where `{p}` is
written: names, ids, positions, colors, texts, times, even a `type`). No param can fill a plain-number key: write the number in the preset. No param works in `play-animation.animation`, `proc-enchants` `mode`/`enchants`,
`add-booster.max-multiplier`, an item map's `amount`/`custom-model-data`, or any `model:`. A preset sees the variables and its own params only (forward a caller's param
with `with: { x: '{x}' }`); a default reads variables only; flow positions pass in. Presets nest
8 deep; self-calls are skipped. Shipped presets:
- `lightning-strike` { damage: '{damage}', radius: 3 }: lightning, area damage (max 5 mobs), ring, thunder.
- `area-burst` { radius: 5, amount: '{damage}', particle: FLAME, sound: ENTITY_GENERIC_EXPLODE }: sphere, damage to all mobs in radius, sound.
- `currency-reward` { currency: money, amount: 100 }: pays and shows an action bar.
- `falling-blade` { item: TRIDENT, height: 7, scale: 2 }: a display that falls onto the mob and lands in 10 ticks (show only; hit 10 ticks later).
- `dice-roll` { face: 'floor({random:1:7})', color: '&7' }: a rolling die title animation (6 frames, 3 ticks apart).
- `dice-face` { face: 1, target: money, percent: 25, time: 30s, label: '&aMoney' }: a face title, an add-booster `dice-<target>` of percent/100, a sound.
## Modes
`mode: second-hand`: a floating copy of the sword while the player has a level, owns a tier and
stands in their zone. On a proc (`swing` only) it dashes through mobs; each dash hit is an extra
swing (procs other swing/kill enchants, never a second hand). `follow:` side [0.9] (-4..4), back
[0.35] (-4..4), height [1.5] (-1..4), stiffness [0.18] (0.01..1), damping [0.78] (0..0.99), sway
[0.12] (0..1), model-rotation ['0 90 45'], rest-pose [look] (look, up), rest-spin [4] (0..45), bob
[0.08] (0..1), bob-speed [0.12] (0..1), face-speed [0.05] (0..2), max-turn [60] (5..180), scale [1]
(0.1..4), glow [none], model. `dash:` speed [1.2] (0.2..4), turn-rate [12] (1..45), targets [1]
(1..10), chain-radius [6] (1..32), pass-through [1.5] (0..6), damage ['{damage}'], proc-enchants
{ mode, enchants }. Optional `actions` run on each mob hit. Every follow and dash value is a plain
number except `dash.damage` (an expression).
`mode: momentum`: a value that builds while the player keeps procing. `momentum:` start [0.1], max
[10] (cap at max-level), cap-at-level-1 [0.1], min [0], active-window-seconds [2.5], gain {
per-proc [0], per-interval [0.1], interval-seconds [15] }, decay { delay-seconds [10],
interval-seconds [10], step [0.1] }, boosts (max 16) [ { target (damage, swings, enchants, luck, enchant:<id>, currency:<id>), per-point [0.01], max-bonus [0],
stacking [additive] } ], booster-name ['&6Momentum'], bossbar { enabled [true], title, color
[YELLOW] (PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE), style [SOLID] (SOLID, SEGMENTED_6, _10,
_12, _20) }, messages { start, decay-start, finish, milestones { 25, 50, 75, 100 } } with
`{value}`, `{cap}`, `{percent}`, `{enchant}`, `{player}`. Usually `chance: 100`, no actions needed.
## Limits (per player, `modules/sword/config.yml` enchants:)
max-sequences 8, max-actions-per-tick 200 (each flow mob/jump/point counts 1), max-particles-per-tick
300, max-entities 32, max-entities-per-tick 8, max-npcs 6. Spread big loops with `every`, keep
`count` at 40 to 80 for shapes, and give long effects a cooldown at least as long as the effect.
## Balancing defaults (from the shipped pack)
| Kind | chance { min, max } | cooldown-ticks | Effect | max-level | cost (souls) |
|------|---------------------|----------------|--------|-----------|--------------|
| Frequent single hit (crit) | 1 to 15 | 0 | `{damage} * (1 + {level} / 100)` | 500 | 50 + 25 x L |
| Kill reward | 5 to 50 (trigger kill) | 0 | `25 * {level}` money | 100 | 200 x 1.08 ^ L |
| Splash / cleave | 10 to 100 | 0 | 50% of the swing to 3 mobs | 5000 | 50 + 20 x L |
| Area burst | 0.5 to 5 | 20 | 7.5x to 10x in radius 6 to 10 | 1000 to 5000 | 100 to 250 + half per L |
| Rain / chain | 0.2 to 4 | 20 to 60 | 5x to 15x per hit, 5 to 12 hits | 2500 to 5000 | 250 to 500 + half per L |
| Zone-wide / siege / fighters | 0.1 to 4 | 100 to 300 | 8x to 9x each, or fighters 2x to 5x | 1000 to 5000 | 250 to 750 + half per L |
| Execute | 0.1 to 2 | 20 | `execute-below: 100` | 100 | 500 + 250 x L |
Average extra damage per swing of a single hit ~ chance x multiplier (5% x 10x ~ +50%).
## Menu tiles
The enchants list is `modules/sword/guis/enchants.yml` (page 1, letters a-u full as shipped) and
`enchants-2.yml` (page 2, a-h used; row 3 `"#h#######"`). Add a letter on a free `#` of the layout
of page 2 (or a new page `enchants-3.yml`, opened by `[sword-enchants] open 3`). Under `items:` add,
IN THIS ORDER (the first item whose view-requirements pass shows):
~~~yaml
<id>-maxed:
material: <MATERIAL>
glow: true
display-name: "<color>&l<Name> &r&f&lEnchant"
lore:
- "&7<what it does>"
- ""
- " &8┃ &7Level: &a%sndungeons_enchant_<id>_level% &8(max)"
- " &8┃ &7Chance: &f%sndungeons_enchant_<id>_chance%%"
- ""
- "&a&lMAX LEVEL"
key: <letter>
view-requirements:
- "%sndungeons_enchant_<id>_state% == maxed"
click-actions:
- "[sword-enchants] upgrade <id>"
- "[sound] UI_BUTTON_CLICK"
<id>-unbuyable:
material: <MATERIAL>
display-name: "<color>&l<Name> &r&f&lEnchant"
lore:
- "&c&lWARNING: &r&4It cannot be bought: its currency"
- "&4%sndungeons_enchant_<id>_currency% &4is not loaded."
key: <letter>
view-requirements:
- "%sndungeons_enchant_<id>_state% == unbuyable"
click-actions:
- "[sword-enchants] upgrade <id>"
- "[sound] UI_BUTTON_CLICK"
<id>:
material: <MATERIAL>
display-name: "<color>&l<Name> &r&f&lEnchant"
lore:
- "&7<what it does>"
- ""
- " &8┃ &7Level: &f%sndungeons_enchant_<id>_level%&7/&f%sndungeons_enchant_<id>_max%"
- " &8┃ &7Chance: &f%sndungeons_enchant_<id>_chance%% &8-> &f%sndungeons_enchant_<id>_next_chance%%"
- " &8┃ &7Cooldown: &f%sndungeons_enchant_<id>_cooldown%"
- " &8┃ &7Next Level: &f%sndungeons_enchant_<id>_cost% %sndungeons_enchant_<id>_currency%"
- " &8┃ &7You Have: &f%sndungeons_enchant_<id>_balance% %sndungeons_enchant_<id>_currency%"
key: <letter>
click-actions:
- "[sword-enchants] upgrade <id>"
- "[sound] UI_BUTTON_CLICK"
~~~
In `modules/sword/guis/upgrade.yml` under `items:` (cell `i` is shared; without these it is empty):
~~~yaml
info-<id>-maxed:
material: <MATERIAL>
glow: true
display-name: "<color>&l<Name> &r&f&lEnchant"
lore:
- " &8┃ &7Level: &a%sndungeons_viewenchant_level% &8(max)"
- " &8┃ &7Chance: &f%sndungeons_viewenchant_chance%%"
key: i
view-requirements:
- "%sndungeons_viewenchant_id% == <id>"
- "%sndungeons_viewenchant_state% == maxed"
info-<id>:
material: <MATERIAL>
display-name: "<color>&l<Name> &r&f&lEnchant"
lore:
- " &8┃ &7Level: &f%sndungeons_viewenchant_level%&7/&f%sndungeons_viewenchant_max%"
- " &8┃ &7Chance: &f%sndungeons_viewenchant_chance%% &8-> &f%sndungeons_viewenchant_next_chance%%"
- " &8┃ &7You Have: &f%sndungeons_viewenchant_balance% %sndungeons_viewenchant_currency%"
key: i
view-requirements:
- "%sndungeons_viewenchant_id% == <id>"
~~~
Other `%sndungeons_enchant_<id>_<field>%` fields: `name`, `description`, `trigger`, `level_raw`,
`left`, `boosted_chance`, `cost_10`, `levels_10`, `max_levels`, `cost_max`, `cooldown_left`,
`prestige`, `prestige_max`, `stars`, `prestige_state`. Placeholders need PlaceholderAPI.
## Patterns
- **Landing hit**: entity (fall from H at speed H/10, lifetime 12) + `delay: 10` + `damage`.
- **Rain**: `loop` (times N, every 2-3) { `preset: falling-blade` + `parallel` { delay 10, damage,
sound } }.
- **Chain**: `chain` { line particle `{from_center}` to `{to_center}`, `damage at {to_pos}` scaled by
`{jump}` }.
- **Ring**: `for-each-point` path circle around `{target_pos}` { lightning or area damage at
`{point_pos}` }.
- **Siege**: `for-each-point` path area-border { entity at `{point_pos}` + `parallel` { delay,
`for-each-mob` from `{point_pos}` max 1 { line + damage } } }.
- **Zone-wide**: `for-each-mob` `mobs: { max: 1000 }` { damage at `{mob_pos}` }.
- **Wounded first**: `order: lowest-health-percent` + damage scaled by `(100 - {mob_health_percent})`.
- **Stacking mark**: `debuff` + text display of `{debuff_stacks}` with `requirement: '{debuff_stacks} > 0'`.
- **Timed buff**: `add-booster` `if-exists: stack`, `time`, `max-multiplier`, `persistent: false`.
- **Milestones**: extra actions with `requirement: '{level} >= N'`.
- **Weighted outcomes**: `random` entries with weights.
- **Summons**: `npc` (copy-player, random-mobs) or `entity` mob with `attack`, plus a cooldown >= lifetime.
## Output format
1. One line: what the enchant does and its feel (frequent, rare, ultimate).
2. `modules/sword/enchants/<id>.yml`: the full file in a yaml block, with short comments.
3. The menu edits: the layout row change and the five tiles, with their file names.
4. Test: `/dungeons reload`, then `/dungeons admin sword testenchant <player> <id> <level>` and a
swing at a zone mob; `/dungeons admin sword enchant <player> <id> <levels>` to see the tiles.
5. The assumptions you made (currency, numbers) and one balancing note.
## Checklist (run it before answering)
- [ ] File name = id, lowercase `a-z0-9-`, at most 56 chars, not `example`, not an existing id.
- [ ] `max-level`, `chance`, `trigger`, `cost` (with a real currency id) are written; root numbers plain.
- [ ] Every expression, position, color and text is quoted.
- [ ] Every key exists in this reference; every required key is present.
- [ ] Every variable exists and is valid where it is used. A bad one in a required key skips the
action; in `chance`/`requirement` it DROPS the guard (the action then always runs).
- [ ] Every `area:` has `radius` and `max-mobs`.
- [ ] Flow positions and flow variables are used only inside their flow.
- [ ] Hits that should land with an entity wait for it (`delay`, `parallel` in loops).
- [ ] Particles that need data have it; no unsupported particle; `glow` is a color name.
- [ ] Plain-number keys are plain (root keys, fade-in, stay, fade-out, size, weight, animation
values, max-multiplier, time, item-map amount, follow/dash/momentum except dash.damage).
- [ ] Long effects have a cooldown >= their duration; loops spread with `every`.
- [ ] No `persistent: true` booster on a frequent proc.
- [ ] Tiles: 3 list items in the order maxed, unbuyable, default, on a free letter; 2 info items.
- [ ] Texts contain no em or en dash.
## Complete example
~~~yaml
# modules/sword/enchants/frost-nova.yml
display-name: '&b&lFrost Nova'
icon: PACKED_ICE
description:
- "&7A ring of frost bursts around"
- "&7your target and hits every mob near it."
max-level: 500
chance: { min: 1, max: 6 }
trigger: swing
cooldown-ticks: 60
cost: { currency: souls, starting-cost: 100, increase-cost-by: 40 }
actions:
- type: particle
particle: SNOWFLAKE
shape: circle
at: '{target_pos}'
offset: '0, 0.2, 0'
radius: 4
count: 40
- type: sound
sound: BLOCK_GLASS_BREAK
at: '{target_pos}'
volume: 0.8
pitch: '{random:1.2:1.6}'
- type: damage
amount: '{damage} * (3 + {level} / 100)'
area: { center: '{target_pos}', radius: 4, max-mobs: 8 }
- type: entity
display: { text: '&b&lFROST NOVA', billboard: center }
at: '{target_top}'
offset: '0, 0.3, 0'
lifetime: 20
movement: { type: rise, speed: 0.04 }
requirement: '{level} >= 250'
~~~