Modding:Monkey patching: Difference between revisions

From Vintage Story Wiki
m
Updated game version and removed needless parameters
(Added more info about harmony patches)
m (Updated game version and removed needless parameters)
Line 1: Line 1:
{{GameVersion|1.15}}
{{GameVersion|1.18}}


== Monkey Patching ==
== Monkey Patching ==
Line 63: Line 63:
     [HarmonyPrefix]
     [HarmonyPrefix]
     [HarmonyPatch(typeof(EntityItem), "ReceiveDamage")]
     [HarmonyPatch(typeof(EntityItem), "ReceiveDamage")]
     public static bool ItemReceivedDamageCancel(EntityItem __instance, float damage) {
    // Parameters are not explicitly required.
     public static bool ItemReceivedDamageCancel() {
         return false;
         return false;
     }
     }
Confirmedusers
6

edits