Testing and Errors
On this page(6)
The test loop
- Save the file in
modules/sword/enchants/. - Run
/dungeons reloadand read the console. A clean file prints nothing. - Run
/dungeons admin sword testenchant <you> <enchant> [level]. - Swing at a mob in your zone: that swing procs the enchant, and only it.
- Adjust, and repeat from step 2.
testenchant uses the level you give, else your own level, else 1. You do not need a level in the
enchant to test it.
Admin commands
| Command | What it does |
|---|---|
/dungeons admin sword testenchant <player> <enchant> [level] | The next swing procs only that enchant |
/dungeons admin sword enchant <player> <enchant> <levels> | Gives levels for free, up to the max level |
/dungeons admin sword max <player> [enchant] | Sets every enchant (or one) to its max level, free |
/dungeons admin sword reset <player> [enchant] | Sets every enchant (or one) to level 0 |
/dungeons admin sword cooldown <player> <enchant|all> [reset|<seconds>] | Shows, resets or sets the enchant cooldowns |
/dungeons admin sword momentum <player> <enchant|all> [value|max|clear|+N|-N] | Shows or changes a momentum run |
/dungeons admin sword prestige <player> <enchant> <stars> | Sets the prestige stars |
/dungeons admin sword handrotation <yaw> <pitch> <roll> | Turns your own second hand's model until a reload |
/dungeons admin inspect player <player> | Shows each enchant's chance chain, cooldown and running sequences |
Permissions: sndungeons.admin.sword.<sub> (OP by default). See
Commands.
A second-hand enchant under testenchant shows your hand for 15 seconds anywhere, even
without a level, and it dashes on your next swing. You need a sword tier.
Reading a warning
Every problem is one console line with the file and the key:
modules/sword/enchants/lightning.yml: actions[1].amount '{dmg} * 2' is not a valid expression:
unknown variable {dmg} (known: level, max_level, damage, i, mob_health, mob_health_percent, jump, point_index, point_count, debuff_stacks, debuff_percent, prestige, prestige_power,
max_prestige); action skippedactions[1]is the first action of the list. Nested lists continue the path:actions[2].actions[3]is the third action inside the second one.- The end of the line says what happened: the action was skipped, or a default was used.
- A broken required value skips that action. A broken optional value uses its default.
- A broken
chanceorrequirementis dropped: the action then runs on every proc. Fix those warnings first. - A file that cannot be read at all skips that enchant. Every other enchant loads.
Common mistakes
| Symptom or warning | Cause | Fix |
|---|---|---|
| The file does not load, YAML error | An unquoted {...} or : | Quote every expression and text: '{damage} * 2' |
unknown variable {dmg} | A typo in a variable | Use a name of the variable table |
{level*2} shows as written | Math inside braces in a text | Texts take variables only. Use a preset number param |
max-level missing warning, level stuck at 1 | No max-level | Add max-level: (1 to 1000000) |
| The enchant procs every swing | No chance (it defaults to 100) | Add chance: |
| Area hit hits only one mob | max-mobs defaults to 1 | Add max-mobs: 1000 or a real cap |
| Nothing happens with an area anchor | Outside a mob area | Test inside your zone's mob area |
| The hit lands before the falling blade | An entity never makes the list wait | Put a delay as long as the fall before the damage |
{mob_pos} reads as the target | Used outside a for-each-mob | Move the action inside the flow |
glow: true does nothing | true is not a color | Write a color name: glow: aqua |
| The enchant is not in the menu | Menus are fully declared | Add its tiles |
The tile shows %sndungeons_...% | PlaceholderAPI is missing | Install PlaceholderAPI |
| The tile shows "unbuyable" | cost.currency is empty or unknown | Set a currency id of currencies/ |
| Only some entities or particles appear | A per-player limit | See Limits and Performance |
| A particle is skipped | It needs data, or is not supported | See Particles |
Debugging a roll
/dungeons debug toggles the debug output live. The /dungeons admin inspect player <player> report covers each enchant the player has. It lists the chance chain a roll computes (base, prestige, boosters, API modifiers), the cooldown left and the running sequences. Use it when an
enchant "never procs": the report shows which step brings the chance down.
Checklist before you ship an enchant
- The console prints no warning for the file after
/dungeons reload. -
testenchantat level 1 and at the max level both look right. - The cooldown is at least as long as the effect, for long effects.
- The tiles show in the list (all three states) and the info tile in the upgrade menu.
- The price curve is checked at the first, a middle and the last level.
- Busy fights stay smooth (entities, particles and loops within the limits).