Class ModHooks
Namespace: Modding
Assembly: HollowKnight.dll
Syntax
public class ModHooks
Methods
| Edit this page View SourceGetAllMods(bool, bool)
Returns an iterator over all mods.
Declaration
public static IEnumerable<IMod> GetAllMods(bool onlyEnabled = false, bool allowLoadError = false)
Parameters
Type | Name | Description |
---|---|---|
bool | onlyEnabled | Should the iterator only contain enabled mods. |
bool | allowLoadError | Should the iterator contain mods which have load errors. |
Returns
Type | Description |
---|---|
IEnumerable<IMod> |
ModEnabled(ITogglableMod)
Gets if the mod is currently enabled.
Declaration
public static bool ModEnabled(ITogglableMod mod)
Parameters
Type | Name | Description |
---|---|---|
ITogglableMod | mod | The togglable mod to check. |
Returns
Type | Description |
---|---|
bool |
ModEnabled(string)
Gets if a mod is currently enabled.
Declaration
public static bool ModEnabled(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the mod to check. |
Returns
Type | Description |
---|---|
bool |
ModEnabled(Type)
Gets if a mod is currently enabled.
Declaration
public static bool ModEnabled(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the mod to check. |
Returns
Type | Description |
---|---|
bool |
OnHeroUpdate()
Called whenever the hero updates
Declaration
public static void OnHeroUpdate()
Remarks
HeroController.Update
OnSavegameLoad(int)
Called directly after a save has been loaded
Declaration
public static void OnSavegameLoad(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id |
Remarks
GameManager.LoadGame
OnSavegameSave(int)
Called directly after a save has been saved
Declaration
public static void OnSavegameSave(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id |
Remarks
GameManager.SaveGame
Events
| Edit this page View SourceAfterAttackHook
Called at the end of the attack function
Declaration
public static event Action<AttackDirection> AfterAttackHook
Event Type
Type | Description |
---|---|
Action<AttackDirection> |
Remarks
HeroController.Attack
AfterPlayerDeadHook
Called after the player dies
Declaration
public static event Action AfterPlayerDeadHook
Event Type
Type | Description |
---|---|
Action |
Remarks
GameManager.PlayerDead
AfterSaveGameClearHook
Called after a game has been cleared from a slot.
Declaration
public static event Action<int> AfterSaveGameClearHook
Event Type
Type | Description |
---|---|
Action<int> |
AfterSavegameLoadHook
Called directly after a save has been loaded. Allows for accessing SaveGame instance.
Declaration
public static event Action<SaveGameData> AfterSavegameLoadHook
Event Type
Type | Description |
---|---|
Action<SaveGameData> |
Remarks
GameManager.LoadGame
AfterTakeDamageHook
Called at the end of the take damage function
Declaration
public static event AfterTakeDamageHandler AfterTakeDamageHook
Event Type
Type | Description |
---|---|
AfterTakeDamageHandler |
ApplicationQuitHook
Called when the game is fully closed
Declaration
public static event Action ApplicationQuitHook
Event Type
Type | Description |
---|---|
Action |
Remarks
GameManager.OnApplicationQuit
AttackHook
Called whenever the player attacks
Declaration
public static event Action<AttackDirection> AttackHook
Event Type
Type | Description |
---|---|
Action<AttackDirection> |
Remarks
HeroController.Attack
BeforePlayerDeadHook
Called when the player dies
Declaration
public static event Action BeforePlayerDeadHook
Event Type
Type | Description |
---|---|
Action |
Remarks
GameManager.PlayerDead
BeforeSavegameSaveHook
Called directly before save has been saved to allow for changes to the data before persisted.
Declaration
public static event Action<SaveGameData> BeforeSavegameSaveHook
Event Type
Type | Description |
---|---|
Action<SaveGameData> |
Remarks
GameManager.SaveGame
BlueHealthHook
Called whenever blue health is updated
Declaration
public static event Func<int> BlueHealthHook
Event Type
Type | Description |
---|---|
Func<int> |
CharmUpdateHook
Called after player values for charms have been set
Declaration
public static event CharmUpdateHandler CharmUpdateHook
Event Type
Type | Description |
---|---|
CharmUpdateHandler |
Remarks
HeroController.CharmUpdate
DashPressedHook
Called whenever the dash key is pressed. Returns whether or not to override normal dash functionality - if true, preventing a normal dash
Declaration
public static event Func<bool> DashPressedHook
Event Type
Type | Description |
---|---|
Func<bool> |
Remarks
HeroController.LookForQueueInput
DashVectorHook
Called during dash function to change velocity
Declaration
public static event Func<Vector2, Vector2> DashVectorHook
Event Type
Type | Description |
---|---|
Func<Vector2, Vector2> | A changed vector. |
Remarks
HeroController.Dash
DoAttackHook
Called at the start of the DoAttack function
Declaration
public static event Action DoAttackHook
Event Type
Type | Description |
---|---|
Action |
DrawBlackBordersHook
Called when a SceneManager calls DrawBlackBorders and creates boarders for a scene. You may use or modify the bounds of an area of the scene with these.
Declaration
public static event Action<List<GameObject>> DrawBlackBordersHook
Event Type
Type | Description |
---|---|
Action<List<GameObject>> |
Remarks
SceneManager.DrawBlackBorders
FinishedLoadingModsHook
Event invoked when mods have finished loading. If modloading has already finished, subscribers will be invoked immediately.
Declaration
public static event Action FinishedLoadingModsHook
Event Type
Type | Description |
---|---|
Action |
GetPlayerBoolHook
Called when anything in the game tries to get a bool from player data
Declaration
public static event GetBoolProxy GetPlayerBoolHook
Event Type
Type | Description |
---|---|
GetBoolProxy |
Remarks
PlayerData.GetBool
GetPlayerFloatHook
Called when anything in the game tries to get a float from player data
Declaration
public static event GetFloatProxy GetPlayerFloatHook
Event Type
Type | Description |
---|---|
GetFloatProxy |
Remarks
PlayerData.GetFloat
GetPlayerIntHook
Called when anything in the game tries to get an int from player data
Declaration
public static event GetIntProxy GetPlayerIntHook
Event Type
Type | Description |
---|---|
GetIntProxy |
Remarks
PlayerData.GetInt
GetPlayerStringHook
Called when anything in the game tries to get a string from player data
Declaration
public static event GetStringProxy GetPlayerStringHook
Event Type
Type | Description |
---|---|
GetStringProxy |
Remarks
PlayerData.GetString
GetPlayerVariableHook
Called when anything in the game tries to get a generic variable from player data
Declaration
public static event GetVariableProxy GetPlayerVariableHook
Event Type
Type | Description |
---|---|
GetVariableProxy |
Remarks
PlayerData.GetVariable
GetPlayerVector3Hook
Called when anything in the game tries to get a Vector3 from player data
Declaration
public static event GetVector3Proxy GetPlayerVector3Hook
Event Type
Type | Description |
---|---|
GetVector3Proxy |
Remarks
PlayerData.GetVector3
HeroUpdateHook
Called whenever the hero updates
Declaration
public static event Action HeroUpdateHook
Event Type
Type | Description |
---|---|
Action |
Remarks
HeroController.Update
LanguageGetHook
Called whenever localization specific strings are requested
Declaration
public static event LanguageGetProxy LanguageGetHook
Event Type
Type | Description |
---|---|
LanguageGetProxy |
Remarks
N/A
NewGameHook
Called whenever a new game is started
Declaration
public static event Action NewGameHook
Event Type
Type | Description |
---|---|
Action |
Remarks
GameManager.LoadFirstScene
SavegameClearHook
Called before a save file is deleted
Declaration
public static event Action<int> SavegameClearHook
Event Type
Type | Description |
---|---|
Action<int> |
Remarks
GameManager.ClearSaveFile
SavegameLoadHook
Called directly after a save has been loaded
Declaration
public static event Action<int> SavegameLoadHook
Event Type
Type | Description |
---|---|
Action<int> |
Remarks
GameManager.LoadGame
SavegameSaveHook
Called directly after a save has been saved
Declaration
public static event Action<int> SavegameSaveHook
Event Type
Type | Description |
---|---|
Action<int> |
Remarks
GameManager.SaveGame
SetPlayerBoolHook
Called when anything in the game tries to set a bool in player data
Declaration
public static event SetBoolProxy SetPlayerBoolHook
Event Type
Type | Description |
---|---|
SetBoolProxy |
Remarks
PlayerData.SetBool
SetPlayerFloatHook
Called when anything in the game tries to set a float in player data
Declaration
public static event SetFloatProxy SetPlayerFloatHook
Event Type
Type | Description |
---|---|
SetFloatProxy |
Remarks
PlayerData.SetFloat
SetPlayerIntHook
Called when anything in the game tries to set an int in player data
Declaration
public static event SetIntProxy SetPlayerIntHook
Event Type
Type | Description |
---|---|
SetIntProxy |
Remarks
PlayerData.SetInt
SetPlayerStringHook
Called when anything in the game tries to set a string in player data
Declaration
public static event SetStringProxy SetPlayerStringHook
Event Type
Type | Description |
---|---|
SetStringProxy |
Remarks
PlayerData.SetString
SetPlayerVariableHook
Called when anything in the game tries to set a generic variable in player data
Declaration
public static event SetVariableProxy SetPlayerVariableHook
Event Type
Type | Description |
---|---|
SetVariableProxy |
Remarks
PlayerData.SetVariable
SetPlayerVector3Hook
Called when anything in the game tries to set a Vector3 in player data
Declaration
public static event SetVector3Proxy SetPlayerVector3Hook
Event Type
Type | Description |
---|---|
SetVector3Proxy |
Remarks
PlayerData.SetVector3
SlashHitHook
Called whenever nail strikes something
Declaration
public static event SlashHitHandler SlashHitHook
Event Type
Type | Description |
---|---|
SlashHitHandler |
TakeDamageHook
Called when damage is dealt to the player
Declaration
public static event TakeDamageProxy TakeDamageHook
Event Type
Type | Description |
---|---|
TakeDamageProxy |
Remarks
HeroController.TakeDamage
TakeHealthHook
Called when health is taken from the player
Declaration
public static event TakeHealthProxy TakeHealthHook
Event Type
Type | Description |
---|---|
TakeHealthProxy |
Remarks
HeroController.TakeHealth