RarityForce

版本 v1.1.0·更新於 2026-01-11

Allows to force rarity for Moai and Chests. Controls: [F1] - toggle force, [F2] - toggle sounds, [Mouse Wheel] - cycle rarity.

模組介紹 作者原文

Rarity Force

A mod for Megabonk that allows you to force rarity for chests and Moai.

Controls

| Key | Action |

|-----|--------|

| F1 | Toggle forced rarity ON/OFF |

| F2 | Toggle sound effects ON/OFF |

| Mouse Wheel Up | Next rarity (Common → Uncommon → Rare → Legendary) |

| Mouse Wheel Down | Previous rarity (Legendary → Rare → Uncommon → Common) |

📋 Requirements

  • Megabonk (Steam version)
  • BepInEx 6.0.0+ (Unity IL2CPP version)

Installation

Automatic (Recommended)

  • Install r2modman or Mod Manager
  • Search for RarityForce in the mod manager
  • Click "Install"
  • Launch the game through the mod manager

Manual

  • Download and install BepInEx 6.0.0+ IL2CPP for your game
  • Run the game once to generate BepInEx folders
  • Download the latest release or GitHub Releases
  • Extract RarityForce.dll into BepInEx/plugins/ folder
  • Launch the game

Building from Source

  • Clone the repository:

git clone

cd rarity_force

  • Copy required DLLs from your Megabonk installation to libs/ folder:
  • BepInEx/core/BepInEx.Core.dll
  • BepInEx/core/BepInEx.Unity.IL2CPP.dll
  • BepInEx/core/0Harmony.dll
  • BepInEx/core/Il2CppInterop.Runtime.dll
  • BepInEx/interop/UnityEngine.dll
  • BepInEx/interop/UnityEngine.CoreModule.dll
  • BepInEx/interop/Assembly-CSharp.dll
  • BepInEx/interop/Il2Cppmscorlib.dll
  • Build the project:

dotnet build -c Release

Or use the build script:

  • Windows: build.bat
  • Linux/Mac:./build.sh
  • The compiled DLL will be in bin/Release/net6.0/RarityForce.dll

How It Works

The mod uses Harmony to patch the game's GetItemRarity method. When forced rarity is enabled (F1), it overrides the game's random rarity selection with your chosen rarity.

Technical Details:

  • Patches Assets.Scripts.Inventory__Items__Pickups.Rarity.GetItemRarity()
  • Uses reflection to access Unity's Input system for IL2CPP compatibility
  • Asynchronous sound playback via Task.Run() to prevent game freezing

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack_IL2CPP

檔案與校驗

檔案名稱
RarityForce-1.1.0.zip
檔案大小
136.4 KiB