Omamori.ModBuildConfig
0.1.0-alpha.4
See the version list below for details.
dotnet add package Omamori.ModBuildConfig --version 0.1.0-alpha.4
NuGet\Install-Package Omamori.ModBuildConfig -Version 0.1.0-alpha.4
<PackageReference Include="Omamori.ModBuildConfig" Version="0.1.0-alpha.4"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Omamori.ModBuildConfig" Version="0.1.0-alpha.4" />
<PackageReference Include="Omamori.ModBuildConfig"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Omamori.ModBuildConfig --version 0.1.0-alpha.4
#r "nuget: Omamori.ModBuildConfig, 0.1.0-alpha.4"
#:package Omamori.ModBuildConfig@0.1.0-alpha.4
#addin nuget:?package=Omamori.ModBuildConfig&version=0.1.0-alpha.4&prerelease
#tool nuget:?package=Omamori.ModBuildConfig&version=0.1.0-alpha.4&prerelease
Omamori.ModBuildConfig
Build setup for Omamori mods for osu!lazer
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Omamori.ModBuildConfig" Version="x.y.z" />
</ItemGroup>
</Project>
Put a mod.json next to the project. Build with the dotnet cli, Visual Studio's msbuild skips checking mod.json, deploying and zipping.
| Property | Default | |
|---|---|---|
OmamoriGamePath |
where osu!lazer is installed | the folder containing osu.Game.dll |
OmamoriDataPath |
osu!'s data folder | where omamori/mods/ is |
OmamoriDeploy |
false |
true copies the mod into $(OmamoriDataPath)/omamori/mods/<id>/ after each build, replacing what's there |
OmamoriPackMod |
true for Release |
zips the mod as <id>-<version>.zip to extract into omamori/mods/ |
OmamoriHarmony |
false |
true lets the mod patch osu! with Harmony, see below |
Deploy and the zip take everything in the build output, including content files, runtimes/ and translated resources.
Using another mod's services
Declare the other mod in mod.json's dependencies, then reference its dll without bundling it, so both mods share one copy of its types:
<ItemGroup>
<OmamoriModReference Include="$(OmamoriDataPath)\omamori\mods\yourname.othermod\OtherMod.dll" />
</ItemGroup>
Patching osu!
When the API doesn't cover something, a mod can patch the game with Harmony. Omamori loads one Harmony for every mod, so don't add the Lib.Harmony package. Set OmamoriHarmony instead, which compiles against Omamori's copy and never bundles it:
<PropertyGroup>
<OmamoriHarmony>true</OmamoriHarmony>
</PropertyGroup>
dotnet new omamori-mod --harmony starts a mod with this set and an example patch.
Apply patches from Load with your mod id as the Harmony id. If your mod crashes, Omamori removes its patches with the rest of it:
new Harmony(context.Manifest.Id).CreateClassProcessor(typeof(MyPatch)).Patch();
To reach lazer's private members, publicize them with Krafs.Publicizer instead of using reflection, so a rename in an osu! update breaks your build rather than your mod:
<PropertyGroup>
<PublicizerRuntimeStrategies>IgnoresAccessChecksTo</PublicizerRuntimeStrategies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Krafs.Publicizer" Version="2.3.2" PrivateAssets="all" />
<Publicize Include="osu.Game:osu.Game.Screens.Menu.IntroScreen.LoadMenu" />
</ItemGroup>
Libraries osu! already has
Any package that osu!lazer also ships is compiled against the game's copy and never bundled, since only one copy can load. To keep your own copy of one anyway, for example a test framework in a test project:
<ItemGroup>
<OmamoriOwnCopy Include="nunit.framework" />
</ItemGroup>
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- ppy.osu.Framework.SourceGeneration (>= 2025.1121.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.5 | 44 | 11/11/2026 |
| 0.1.0-alpha.4 | 53 | 11/2/2026 |
| 0.1.0-alpha.3 | 57 | 10/30/2026 |
| 0.1.0-alpha.2 | 53 | 10/30/2026 |
| 0.1.0-alpha.1 | 58 | 10/30/2026 |