• Stars
    star
    4,825
  • Rank 8,315 (Top 0.2 %)
  • Language
    C#
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library for patching, replacing and decorating .NET and Mono methods during runtime

Harmony
Version 2
A library for patching, replacing and decorating
.NET and Mono methods during runtime.

About

Harmony gives you an elegant and high level way to alter the functionality in applications written in C#. It works great in games and is well established in titles like 7 Days To Die, BattleTech, Besiege, Cities:Skylines, Kerbal Space Program, Oxygen Not Included, Ravenfield, Rimworld, Sheltered, Stardew Valley, Staxel, Subnautica, The Ultimate Nerd Game, Total Miner, Unturned, SCP: Secret Laboratory and many more.

It is also used in unit testing WPF controls and in many other areas.

How it works

If you develop in C# and your code is loaded as a module/plugin into a host application, you can use Harmony to alter the functionality of all the available assemblies of that application. Where other patch libraries simply allow you to replace the original method, Harmony goes one step further and gives you:

β€’ A way to keep the original method intact
β€’ Execute your code before and/or after the original method
β€’ Modify the original with IL code processors
β€’ Multiple Harmony patches co-exist and don't conflict with each other
β€’ Works at runtime and does not touch any files

Installation

Installation is done by using 0Harmony.dll in your project or by using the Lib.Harmony nuget package.

Documentation

Please check out the documentation and join the official discord server.

Contribute

I put thousands of hours into this project and its support. So every little action helps:

β€’ Upvote this stackoverflow answer
β€’ Spread the word in your developer communities
β€’ Become a GitHub sponsor or a Patreon

This project uses the great MonoMod.Common library by 0x0ade.

Harmony 1

Harmony 1 is deprecated and not under active development anymore. The latest version of it (v1.2.0.1) is stable and contains only minor bugs. Keep using it if you are in an environment that exclusively uses Harmony 1. Currently Harmony 1.x and 2.x are NOT COMPATIBLE with each other and SHOULD NOT BE MIXED. The old documentation can still be found at the Wiki.


Β 

More Repositories

1

HarmonyRimWorld

A RimWorld mod that installs Harmony for all other mods
C#
96
star
2

Zombieland

Rimworld Mod featuring zombie hordes
C#
46
star
3

RimGPT

Let ChatGPT throw shade on your gameplay. Needs two license keys: ChatGPT + Azure (for TTS)
C#
27
star
4

CameraPlus

Camera+ for RimWorld
C#
24
star
5

Achtung2

Command your colonists like a boss!
C#
24
star
6

Reloader

A mod helper for RimWorld that allows you to develop and patch code while the game is running
C#
14
star
7

RimWorld4Debugging

This project will help you with debugging RimWorld
JavaScript
10
star
8

Puppeteer

Puppeteer allows Twitch viewers to control colonists live!
C#
6
star
9

VisualExceptions

Handles RimWorld exceptions and shows them in a visual way
C#
5
star
10

RangeFinder

Constantly checking the shooting range of your colonists? Range Finder makes it easy.
C#
5
star
11

JustIgnoreMePassing

C#
5
star
12

RimBattle

C#
4
star
13

RimWorld-DevHelper

A small helper for mod developers
C#
4
star
14

ReverseCommands

Reverses the context menu so you can select something to interact with, followed by an action and the colonist that should execute that action. No need to select colonists first and much less scrolling through the map.
C#
4
star
15

harmonycheck

Simple dll for RimWorld that detects older Harmony versions and alerts you about them
C#
3
star
16

SameSpot

Rimworld Mod that allows multiple colonists to be drafted at the same location
C#
3
star
17

LineOfSightFix

Fixes Line Of Sight calculations in RimWorld
C#
3
star
18

CarefulRaids

More careful raiders - can you handle them?
C#
3
star
19

RimWorld-GUILocator

A small helper mod that logs drawing methods when you middle mouse click on the GUI
C#
2
star
20

RiceRiceBaby

C#
2
star
21

ApparelX

Rimworld Mod: Get rid of deadmans apparel quick. Adds a checkbox to trade dialogs that shows only apparel worn by a corpse.
C#
1
star
22

ZeFlammenwerfer

An almost real flamethrower for RimWorld
C#
1
star
23

MagicTutor

A framework for RimWorld mods that show hints for new features in a mod
C#
1
star
24

SheepHappens

C#
1
star
25

Firebaser

A lightweight mono 3.5 compatible connector to the legacy firebase api. See https://firebase.google.com/docs/database/ and https://firebase.google.com/docs/database/rest/start
C#
1
star
26

PolySlinger

Build with giant Tetriminos in VR
C#
1
star
27

Rimionship

A RimWorld Mod for the Rimionship Tournaments
C#
1
star
28

HelloChat

C#
1
star
29

test

testing
1
star
30

popremote

A Popcorn-Time remote build with Ionic
JavaScript
1
star
31

RimWorld-CrossPromotion

This framework patches the mod page of RimWorld mods so it shows all mods of the author
C#
1
star
32

TwitchTanks

With TwitchTanks you can create a tank game overlay for your twitch stream and your viewers can use chat commands to control up to four tanks and battle each other.
C#
1
star
33

greet-grpc

JavaScript
1
star
34

MOD-E

A RimWorld mod that automatically adjusts your mod list to the game you load.
C#
1
star
35

Puppeteer-Central

The server infrastructure to my RimWorld mod Puppeteer
JavaScript
1
star
36

ModBuilder

A command line binary that can execute generic tasks that are useful before and after your compile phase.
C#
1
star
37

RimWorld-NewMod

C#
1
star