Plugin Development¶
Wayward Crown supports a plugin system that lets you add or override classes, enemies, buildings, and language packs.
Plugin Structure¶
Plugins are placed as folders inside the plugins/ directory:
plugins/
└── my_plugin/
├── plugin.json # Plugin metadata (required)
├── content/
│ ├── adventurer_classes.json # Custom classes
│ ├── enemies.json # Custom enemies
│ └── buildings.json # Custom buildings
├── lang/
│ ├── en.json # English translation
│ └── zh_TW.json # Traditional Chinese translation
└── assets/ # Custom image assets
plugin.json¶
{
"id": "my_plugin",
"name": "My Plugin",
"version": "1.0.0",
"author": "Author Name",
"description": "Plugin description"
}
Load Order¶
- Core content (
game/content/) is loaded first - External plugins are loaded in alphabetical order by folder name
- Later-loaded plugins override previously defined entries with the same ID
- Plugins listed in
plugins/disabled.jsonare completely skipped
Custom Adventurer Classes¶
Define classes in content/adventurer_classes.json:
[
{
"id": "NINJA",
"i18n_key": "class_ninja",
"color": [30, 30, 30],
"stats": {
"hp": [35, 80],
"str": [5, 15],
"agi": [10, 25],
"int": [3, 10],
"lck": [5, 15]
},
"desires": {
"gold": [0.3, 0.8],
"safety": [0.0, 0.2],
"glory": [0.5, 1.0],
"curiosity": [0.3, 0.7]
},
"level_up": {
"primary": "agi",
"primary_range": [3, 7],
"secondary": "str",
"secondary_range": [1, 3]
},
"attack_stat": "agi",
"attack_range": 5,
"skills": {
"3": {"id": "shadow_step", "i18n": "advskill_shadow_step", "effect": {"dodge": 0.2}},
"6": {"id": "poison_blade", "i18n": "advskill_poison_blade", "effect": {"atk_flat": 6}}
}
}
]
Overriding Core Classes
Using the same id as a core class (e.g., "WARRIOR") will override the core class definition.
Custom Enemies¶
Define enemies in content/enemies.json:
[
{
"id": "ORC",
"i18n_key": "enemy_orc",
"color": [100, 150, 50],
"spawn_tile": "MOUNTAIN",
"danger_level": 3,
"stats": {
"hp": 200,
"attack": 10,
"defense": 8,
"speed": 0.8,
"xp": 50,
"gold": 25,
"attack_range": 3,
"sight_range": 18
}
}
]
Custom Buildings¶
Define buildings in content/buildings.json:
[
{
"id": "TAVERN",
"i18n_key": "building_tavern",
"color": [160, 120, 60],
"cost": 180,
"hp": 700,
"max_level": 2,
"upgrade_costs": [300],
"attracts": null,
"category": "shop"
}
]
Language Pack Plugins¶
The simplest type of plugin — only requires plugin.json and lang/*.json:
plugins/example_jp/
├── plugin.json
└── lang/
└── ja.json
Language JSON files use a key-value format with support for {placeholder} substitution:
{
"window_title": "ウェイワード・クラウン",
"log_defeated_enemy": "{adv}が{enemy}を倒した(金:{gold} XP:{xp})"
}
Enabling / Disabling¶
- Plugins can be enabled or disabled from the in-game settings menu
- Disabled plugins are recorded in
plugins/disabled.json - A game restart is required after disabling a plugin for changes to take effect
Remote Plugin Repository¶
The game supports downloading plugins from a remote source:
- The plugin index is stored in
plugins/repo.json - You can browse and install plugins from the settings menu
- Downloaded plugins are automatically extracted into the
plugins/directory