A starter CastleForge community mod repository that demonstrates a clean mod structure, config loading, command registration, embedded dependency handling, and a reusable Harmony patch bootstrap.
Best for: mod authors who want a practical example they can clone, rename, and turn into their own standalone CastleForge mod project.
CastleForge-ExampleCommunityMod is a standalone, community-facing adaptation of the official CastleForge Example sample.
It is meant to show what a clean third-party CastleForge mod repository can look like when it lives outside the main CastleForge repo.
This repository includes:
- a ready-to-read starter README
- a simple sample mod project
- config creation and loading
- command registration examples
- Harmony bootstrap / unpatch flow
- embedded dependency resolution helpers
- a lightweight project layout you can rename and expand
CastleForge-ExampleCommunityMod/
├─ README.md
├─ .gitignore
└─ ExampleCommunityMod/
├─ Embedded/
│ ├─ 0Harmony.dll
│ ├─ EmbeddedExporter.cs
│ └─ EmbeddedResolver.cs
├─ Patching/
│ └─ GamePatches.cs
├─ Properties/
│ └─ AssemblyInfo.cs
├─ Startup/
│ └─ ECMConfig.cs
├─ _Images/
│ ├─ ExampleCommands.gif
│ ├─ ExampleConfig.png
│ ├─ ExampleHarmony.png
│ └─ Preview.png
├─ ExampleCommunityMod.cs
└─ ExampleCommunityMod.csproj
ModBaseentrypoint- safe
Start()initialization - clean shutdown / Harmony unpatching
CommandDispatcherregistration- example command handlers
- help registry hookup
- create config file on first run
- parse and validate values
- apply settings into fast runtime statics
- embedded managed DLL resolution
- optional native DLL preload/export pattern
- a reusable embedded resource extraction helper
- centralized patch registration
- best-effort patch application
- isolated unpatching by Harmony ID
This repository is still intentionally a starter / teaching example, not a feature-heavy finished gameplay mod.
Some handlers and patch containers are left lightweight on purpose so mod authors can replace the sample logic with their own real implementation.
This sample is designed to be used alongside the main CastleForge project.
In practice, most authors will either:
- keep this repository as the source repo for their mod and adapt the project references to their local CastleForge setup, or
- copy/rename the project into their own CastleForge workspace while using this repository as the public-facing source history for the mod.
Because CastleForge projects commonly rely on shared ReferenceAssemblies, ModLoader, and ModLoaderExtensions, you may want to align the project references in ExampleCommunityMod.csproj with your own local workspace layout before building.
If you want to turn this into a real mod, the usual first changes are:
- replace the sample command logic with real gameplay behavior
- add real
[HarmonyPatch]classes underPatching/ - update the config keys and defaults in
ECMConfig.cs - replace the preview image and README screenshots
- publish releases from this repo
- add a catalog entry to
CastleForge-CommunityMods
When you are ready to list the mod publicly in the community catalog, create a submission folder in CastleForge-CommunityMods that includes:
mod.jsonREADME.mdpreview.pngorpreview.gif
That catalog repo is for discovery.
This repo is the actual source repository for the mod.
CastleForge-ExampleCommunityMod is a clean standalone example repo that shows how to structure a third-party CastleForge mod project with commands, config, embedded dependencies, and Harmony patch scaffolding.
