Modules
On this page(6)
Every feature of SnDungeons beyond the core is a module: the zones, the sword, perks, auras and the rest. A module keeps its config, menus, messages and content in its own folder. You switch each one on or off with one key and a reload, without a restart.
| Folder | modules/<id>/, one per module |
| List | /dungeons admin modules |
| Admin commands | /dungeons admin <module> ... and /dungeons admin <module> help |
| Switch | enabled: (first key of modules/<id>/config.yml) + /dungeons reload |
The module folder
Each module has its own folder under modules/, named after its id. An id is lowercase letters, digits and -. The same id names the module's menus, its messages and its permission nodes.
| Path | What it holds |
|---|---|
modules/<id>/config.yml | The module's settings. Its first key is always enabled:. |
modules/<id>/guis/<file>.yml | The module's menus. Each one has the menu id <id>:<file>, so modules/zones/guis/stages.yml is zones:stages. |
modules/<id>/lang/messages_en.yml | The module's messages. Each key is served as <id>.<key>, so buy.success of the zones is zones.buy.success. |
| Content folders and files | The things the module is made of, one file each: modules/zones/zones/, modules/perks/perks/, modules/sword/enchants/... |
Managed files. The config.yml, the menus and the messages are managed by SnLib. On every boot, new keys from the jar merge into your files, and your values and comments stay. See Files and Reloads.
Content is yours. A content folder is created with the shipped examples once, when it does not exist as the module enables. After that SnDungeons never updates, merges or recreates it. A file you delete stays deleted, and a key you delete reads its default. A few modules keep their content in one file instead (modules/sword/tiers.yml, modules/attributes/levels.yml), with the same rule.
Want a shipped example back? The jar is a zip. Open it and copy the file from its modules/<id>/ folder into yours, then run /dungeons reload.
Switching a module on or off
Set enabled: false in modules/<id>/config.yml and run /dungeons reload. The module stops at once, with no restart:
- its player commands (
/perks,/zone...) and its/dungeons admin <module>group disappear; - its menus close and unload, and its messages, placeholders and action tags are removed;
- its boosters leave every player's totals, and its tiles in
/settingsshow as not available; - its listeners and timers stop.
What players earned stays stored in the database: tiers, progress, perks, totems, and so on. Set enabled: true and reload, and everything comes back as it was.
enabled: takes true or false, and a missing key reads true. Any other value keeps the module OFF and logs one console line per start or reload. That catches a typo such as flase, a quoted 'no' or a number:
modules/<id>/config.yml: enabled '<value>' is not true or false; the module stays offA module that fails to start is logged with its id and left off, while the other modules carry on. The next /dungeons reload tries it again.
Admin commands of a module
| Command | Permission | Description |
|---|---|---|
/dungeons admin modules | sndungeons.admin.modules | Lists every module with its display-name, its id and its state (Enabled or Disabled). |
/dungeons admin <module> help | sndungeons.admin.<module> | Lists the admin commands of one module. |
Each module group has the node sndungeons.admin.<module>, and each command sndungeons.admin.<module>.<command>. A group exists only while its module is enabled. The full lists are in Commands and Permissions.
The display-name: key of each module config is the name /dungeons admin modules shows (color codes allowed). The state words come from the status: section of lang/messages_en.yml (status.enabled, status.disabled).
A module that needs another plugin
The companions module is the content of the SnCompanions plugin. Without it, the module stays off with ONE console warning that gives the reason, never an error:
Module 'companions' stays off: <reason>Every /dungeons reload asks again, so the module starts as soon as the plugin it needs is there. The other modules never need another plugin. Some features use one when it is installed: the zones' island visibility uses SnSuperiorSkyblock, and the models use BetterModel or ModelEngine.
How modules fit together
No module depends on another module's code. Each one reads the others through the core (boosters, placeholders, the zone fight), so switching one off never breaks another:
- the sword lore shows the perk and crystal lines through placeholders, and drops a line whose module is off;
- the
/swordtiers menu shows its Perks, Attributes and Crystals buttons only while those modules are on.
The zone fight needs two modules: you hit the mobs of the zones module with the sword of the sword module. Most other modules feed or use that fight, so keep both on.
The modules
| Module | Page | Player command | What it adds |
|---|---|---|---|
zones | Zones | /zone, /zones | Zones with stages bought in order, and mobs only each player sees. |
sword | Sword | /sword | Every player's sword: tiers that raise its damage and swings, and its enchants. |
perks | Perks | /perks | One sword perk per player, level I to V, rolled with tickets. |
auras | Auras | /auras | Auras that orbit their owner and give a booster, with tiers and rarities. |
milestones | Milestones | /milestones | Categories of milestones on one stat each, with rewards claimed once. |
totems | Totems | /totems | Virtual totems equipped in slots, leveled by killing zone mobs. |
attributes | Sword Attributes | /attributes | Passive levels unlocked by a leveling, each with fixed boosts. |
crystals | Crystals | /crystals | Crystals applied to the slots of the sword that multiply booster totals. |
armors | Armors | /armor | The wardrobe: an armor level from swing experience, sets, skins and set upgrades. |
autofighter | Autofighter | /autofighter | An NPC with your skin that you ride while it walks your fight from mob to mob. |
afk | AFK Clones | /afk | Clones that fight for a player who stands still in their mob area. |
heroes | Heroes | /heroes | Small heroes that fight the mobs of your zone by their role. |
contests | Contests (Events) | /event | Scheduled events where targets appear at a fixed rate and are caught by your own click. |
companions | Companions | /egg | Companion eggs for each zone stage, sold in SnDungeons currencies. Needs SnCompanions. |
hunts | Hunts | /hunt | Hunt slots, each an objective with a difficulty, a target and rewards. |
cookies | Cookies | none | Items players eat for Luck and luck effect bonuses while they last. |
anticheat | Anticheat | none | Flags killaura and bots through the zone fight's own clicks. |
Every module ships enabled.
The sword enchants are part of the sword module, but they have their own section: How Enchants Work.