Mod Calls

From Mod of Redemption Wiki
Jump to navigation Jump to search

Mod Calls are special functions that can be used with tModLoader's .Call() function to get or set different values from other mods. This page lists the Mod Calls that are provided by the Mod of Redemption along with what they are used for.

Mod Calls Table

Function Returns Parameters
addElementNPC (bool) Whether the NPC possesses the Elemental bonus. (int) The ID of the NPC to receive the Elemental bonus.
(int) The ID of the Elemental bonus to be applied to the NPC.
addElementItem (bool) Whether the item possesses the Elemental bonus. (int) The ID of the item to receive the Elemental bonus.
(int) The ID of the Elemental bonus to be applied to the item.
addElementProj (bool) Whether the projectile possesses the Elemental bonus. (int) The ID of the projectile to receive the Elemental bonus.
(int) The ID of the Elemental bonus to be applied to the projectile.
addItemToBluntSwing (null) (int) The ID of the item to be excluded from receiving the Slash bonus.
addNPCToElementTypeList (null) (int) The ID of the NPC to be associated with an NPC type.
(string) The name of the NPC type. Many aliases are accepted.

// In SetStaticDefaults() of ModItem, ModProjectile, or ModNPC
if (!ModLoader.TryGetMod("Redemption", out var redemption))
return;

// For ModItem
redemption.Call("addElementItem", 13, Type); // Psychic element ID
// For ModProjectile
redemption.Call("addElementProj", 4, Type); // Ice element ID
// For ModNPC
redemption.Call("addElementNPC", 6, Type); // Wind element ID

Aliases

Some of the functions above mention accepting different aliases for the string parameters. One alias for each flag will be listed below in tables for each function, however alternatives that use different cases or spacing will still be accepted.

addNPCToElementTypeList

Queriable Strings
Skeleton
SkeletonHumanoid
Humanoid
Undead
Spirit
Plantlike
Demon
Cold
Hot
Wet
Dragonlike
Inorganic
Robotic
Armed
Hallowed
Dark
Blood
Slime

Notes

  • Providing incorrect or too few/many arguments to any of these functions will result in an ArgumentException being thrown.