3.1 KiB
Whack (Megabonk IL2CPP Godmode)
BepInEx plugin for Megabonk (Unity 2023, IL2CPP) that enables player godmode by intercepting the PlayerHealth damage pipeline.
Status: Only HARD godmode (skip damage) is implemented and confirmed working. A “soft” mode (zeroing damage but keeping effects) is not tested in this repo.
BepInEx & Tooling
- BepInEx: 6.0.0-be.735 (IL2CPP) recommended (matches dev logs). Other recent bleeding-edge BepInEx 6 IL2CPP builds will likely work.
- Unity Runtime: 2023.2.x (game specific)
- .NET SDK: .NET 6
- IDE: Visual Studio 2022
Manual references (add these in VS)
Because the .csproj uses absolute HintPaths, you must manually add references on your machine:
- 0Harmony —
...\Megabonk\BepInEx\core\0Harmony.dll - BepInEx.Core —
...\Megabonk\BepInEx\core\BepInEx.Core.dll - BepInEx.Preloader.Core —
...\Megabonk\BepInEx\core\BepInEx.Preloader.Core.dll - BepInEx.Unity.Common —
...\Megabonk\BepInEx\core\BepInEx.Unity.Common.dll - BepInEx.Unity.IL2CPP —
...\Megabonk\BepInEx\core\BepInEx.Unity.IL2CPP.dll - Assembly-CSharp (DummyDll) —
...\Il2CppDumper\DummyDll\Assembly-CSharp.dll(from your Il2CppDumper output)
In Properties for each reference, set Copy Local = False. The DummyDll is compile-time only (do not ship it).
If your BepInEx install uses a different folder structure, point the references to your actual files.
Build (Visual Studio 2022)
- Install BepInEx 6 IL2CPP into the game folder and run the game once.
- In VS, open
Whack.sln. - Add the manual references listed above (right‑click project → Add → Reference → Browse).
- Ensure Target Framework is .NET 6.0 (
net6.0). - Select Release | Any CPU (or Debug).
- Build → Build Solution.
- Output DLL:
Whack\bin\Release\net6.0\Whack.dll
Install
- Copy
Whack.dllto the game’sBepInEx\plugins\folder:...\Megabonk\BepInEx\plugins\Whack.dll - Launch the game.
- Verify in
BepInEx\LogOutput.logthat the plugin loads (look for “Whack loaded” and Harmony patches).
How it works (HARD mode)
The plugin patches PlayerHealth.Damage(DamageContainer dc, bool ignoreShield) to skip the original method, preventing any HP loss. It also guards common external damage entry points where applicable.
- Pros: Simple and robust godmode.
- Cons: Any effects performed inside the original
Damage()(e.g., specific shakes/counters) won’t run.
Troubleshooting
- “0 plugins to load” → Ensure your main class has
[BepInPlugin("com.apfelteesaft.megabonk.whack", "Whack", "1.0.0")]and the DLL is inBepInEx\plugins\. - Missing types at compile time → Add Assembly-CSharp (DummyDll) from Il2CppDumper.
- Missing types at runtime → Do not ship DummyDlls. Only the plugin DLL goes in
plugins\. - Wrong BepInEx → Use the IL2CPP build of BepInEx 6.
- Blocked DLL → Right‑click the DLL → Properties → Unblock.
License
None (no license specified). Use privately at your own discretion.