Enum "ModCallbacks"

DLC

Value

Enumerator

Comment

{: .abp .tooltip .badge }

0

MC_NPC_UPDATEFunction Args: (EntityNPC)Optional callback Args: EntityType {: .copyable }

Called after an NPC is updated. Returning any value will have no effect on later callback executions. This callback will NOT fire when the NPC is playing the "Appear" animation. For example, when a Gaper spawns, it will fire on frame 1, then on frame 31 and onwards. This code will print "Hello World!" for every NPC Update. If the NPC is of the type "ENTITY_GAPER", it will also print "Gaper found". function mod:myFunction(entity) -- 'entity' contains a reference to the NPC print("Hello World!") end mod:AddCallback(ModCallbacks.MC_NPC_UPDATE, mod.myFunction) function mod:myFunction2(entity) -- 'entity' contains a reference to the NPC print("Gaper found!") end mod:AddCallback(ModCallbacks.MC_NPC_UPDATE, mod.myFunction2, EntityType.ENTITY_GAPER)

{: .abp .tooltip .badge }

1

MC_POST_UPDATEFunction Args: - {: .copyable }

Called after every game update. Returning any value will have no effect on later callback executions. This callback is called every few frames the game is active. It will not be called, when its paused (for example on screentransitions or on the pause menu).

{: .abp .tooltip .badge }

2

MC_POST_RENDERFunction Args: - {: .copyable }

Called after every game render. Returning any value will have no effect on later callback executions. It is highly recommended to only use this function when you want to render something. Its not recommended to use this function for things which are not frequently used or need constant recalculation.

{: .abp .tooltip .badge }

3

MC_USE_ITEM Function Args: (CollectibleType, RNG)Optional callback Args: CollectibleType {: .copyable }

Called when a custom active item is used, after discharging it. The item RNG allows for the item's random events to be seeded. Return true to show the "use item" animation, otherwise false.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

4

MC_POST_PEFFECT_UPDATE Function Args: (EntityPlayer)Optional callback Args: PlayerType {: .copyable }

Called for each player, each frame, after the player evaluates the effects of items that must be constantly evaluated.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

5

MC_USE_CARD Function Args: (Card)Optional callback Args: Card {: .copyable }

Called when a card/rune is used.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

6

MC_FAMILIAR_UPDATE Function Args: (EntityFamiliar)Optional callback Args: FamiliarVariant {: .copyable }

Called every frame for each familiar. Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

7

MC_FAMILIAR_INIT Function Args: (EntityFamiliar)Optional callback Args: FamiliarVariant {: .copyable }

Called just after a familiar is initialized. Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityFamiliar. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

8

MC_EVALUATE_CACHE Function Args: (EntityPlayer, CacheFlag)Optional callback Args: CacheFlag {: .copyable }

Called one or more times when a player's stats must be re-evaluated, such as after picking up an item, using certain pills or manually calling EvaluateItems() on an EntityPlayer. Returning any value will have no effect on later callback executions.Hint: Use this to let custom items change the player's stats, familiars, flying, weapons, etc. Items tell the game which stats they affect using cache values in items.xml. Then the callback should respond to the CacheFlag by setting the corresponding player stat. Other items' stat modifiers, multipliers, etc are applied before this callback is called.

{: .abp .tooltip .badge }

9

MC_POST_PLAYER_INIT Function Args: (EntityPlayer)Optional callback Args: PlayerVariant* {: .copyable }

Called after a Player Entity is initialized. The optional parameter can be used to specify a Player Variant. 0 = Player, 1 = Co-Op-BabyReturning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityPlayer. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

10

MC_USE_PILL Function Args: (PillEffect)Optional callback Args: PillEffect {: .copyable }

Called when a pill is used.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

11

MC_ENTITY_TAKE_DMG Function Args: (TookDamage [Entity], DamageAmount [float], DamageFlags [int], DamageSource [EntityRef], DamageCountdownFrames [int])Optional callback Args: EntityType {: .copyable }

Called before new damage is applied. If the entity has a DAMAGE_COUNTDOWN flag, it will ignore any other DAMAGE_COUNTDOWN hits for the duration specified. Return true or nil if the entity or player should sustain the damage, otherwise false to ignore it. If the entity is an EntityPlayer, the DamageAmount is the integer number of half-hearts of damage that the player will take. Otherwise, DamageAmount is a number of hit points. Returning any value besides nil will prevent later callbacks from being executed.

{: .abp .tooltip .badge }

12

MC_POST_CURSE_EVAL Function Args: (Curses) {: .copyable }

Curses is a bitmask containing current curses. Called after the current Level applied it's curses. Returns the new curse bitmask. Use Isaac.GetCurseIdByName() to get the curseID.If a number is returned, it will be the "Curses" arg for later executed callbacks.Returning a value that is not an integer or nil will cause the game to crash.The last callback to return a valid return value wins out and overwrites previous callbacks' return values

{: .abp .tooltip .badge }

13

MC_INPUT_ACTION Function Args: (Entity, InputHook, ButtonAction)Optional callback Args: InputHook {: .copyable }

It is called when game/game entities wants to read an action input. Entity can be nil if the input is not read from an entity class. The InputHook value can be used to determine if this callback was called through Input.IsActionTriggered(), Input.IsActionPressed(), or Input.GetActionValue() Return nil if you don't want to overwrite the input or value. The return value can be bool if it's a IS_ACTION_XXX hook or float if it's an GET_ACTION_VALUE hook. Float values should be in range of 0.0 and 1.0 Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

14

MC_LEVEL_GENERATOR {: .copyable }

This callback doesn't work right now and will never be called by the game!

{: .abp .tooltip .badge }

15

MC_POST_GAME_STARTED Function Args: (IsContinued [bool]) {: .copyable }

This function gets called when you start a game. The boolean value is true when you continue a run, false when you start a new one. This callback will be called after MCPOST_NEW_ROOM and after MC_POST_NEW_LEVEL. Returning any value will have no effect on later callback executions. local function onStart(,bool) print(bool) end mod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, onStart)

{: .abp .tooltip .badge }

16

MC_POST_GAME_END Function Args: (IsGameOver [bool]) {: .copyable }

This function gets called when the game over screen appears, or when the an ending starts playing. The boolean value is true when you died and got a game over, false when you won and got an ending. Returning any value will have no effect on later callback executions. local function onEnd(_,bool) print(bool) end mod:AddCallback(ModCallbacks.MC_POST_GAME_END, onEnd)

{: .abp .tooltip .badge }

17

MC_PRE_GAME_EXIT Function Args: (ShouldSave [bool]) {: .copyable }

This function gets called when you quit a run. The boolean value is true when the game would normally create a continuable save, false when it wouldn't. Called twice when the game plays an ending. Returning any value will have no effect on later callback executions. local function onExit(_,bool) print(bool) end mod:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, onExit)

{: .abp .tooltip .badge }

18

MC_POST_NEW_LEVEL Function Args: - {: .copyable }

This triggers after transitioning a level or stage. Its always called after MC_POST_NEW_ROOM. Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

19

MC_POST_NEW_ROOM Function Args: - {: .copyable }

This triggers after entering a room. Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

20

MC_GET_CARDFunction Args: (RNG, Card, IncludePlayingCards [bool], IncludeRunes [bool], OnlyRunes [bool]) {: .copyable }

This callback is used for handling Card Pools. Because not all cards have the same chance to spawn, use RNG for a seeded random selection.You can use the boolean values as a filter for the selection. The return value determines, what Card will be spawned. Return nil to not replace the spawned card. Returned values will not update the "Card" arg of later executed callbacks.Returning a value that is not an integer or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values

{: .abp .tooltip .badge }

21

MC_GET_SHADER_PARAMS Function Args: (ShaderName [string]) {: .copyable }

Returns a table containing a key -> value pair for custom shader parameters.

{: .abp .tooltip .badge }

22

MC_EXECUTE_CMDFunction Args: (CMD [string], Parameters [string]) {: .copyable }

Returns a string separated by (newline) per output line CMD is the first word of the Console input. The parameters are the rest of the Input.This function is NOT called for default game commands like Spawn or Debug. Returning a string will print it to the console. Returning any value will have no effect on later callback executions. function mod.oncmd(_, command, args) print(command) print(args) end mod:AddCallback(ModCallbacks.MC_EXECUTE_CMD, mod.oncmd) -- executing command "Test apple 1 Pear test" prints -- Test -- apple 1 Pear test

{: .abp .tooltip .badge }

23

MC_PRE_USE_ITEMFunction Args: (CollectibleType, RNG)Optional callback Args: CollectibleType {: .copyable }

Called before an item is used. Return true to prevent the default code of an item to be triggered. This will still discharge the item. Returning any value besides nil will also prevent later callbacks from being executed.

{: .abp .tooltip .badge }

24

MC_PRE_ENTITY_SPAWNFunction Args: (EntityType, Variant [int], SubType [int], Position [Vector], Velocity [Vector], Spawner [Entity], Seed [int]) {: .copyable }

Called right before an entity is spawned. Optional: Return a table with new values { Type, Variant, Subtype, Seed } to override these values of the spawned entity.Returning a value that is not a table or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values

{: .abp .tooltip .badge }

25

MC_POST_FAMILIAR_RENDERFunction Args: (EntityFamiliar, RenderOffset [Vector])Optional callback Args: FamiliarVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

26

MC_PRE_FAMILIAR_COLLISIONFunction Args: (EntityFamiliar, Collider [Entity], Low [bool])Optional callback Args: FamiliarVariant {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback without defining a FamiliarVariant unless its absolutely nessesary!

{: .abp .tooltip .badge }

27

MC_POST_NPC_INITFunction Args: (EntityNPC)Optional callback Args: EntityType {: .copyable }

Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityNPC. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

28

MC_POST_NPC_RENDERFunction Args: (EntityNPC, RenderOffset [Vector])Optional callback Args: EntityType {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

29

MC_POST_NPC_DEATHFunction Args: (EntityNPC)Optional callback Args: EntityType {: .copyable }

Gets called after the Death animation is played.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

30

MC_PRE_NPC_COLLISIONFunction Args: (EntityNPC, Collider [Entity], Low [bool])Optional callback Args: EntityType {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback without defining an EntityType unless its absolutely nessesary!

{: .abp .tooltip .badge }

31

MC_POST_PLAYER_UPDATEFunction Args: (EntityPlayer)Optional callback Args: PlayerVariant* {: .copyable }

The optional parameter can be used to specify a Player Variant. 0 = Player, 1 = Co-Op-BabyReturning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

32

MC_POST_PLAYER_RENDERFunction Args: (EntityPlayer, RenderOffset [Vector])Optional callback Args: PlayerVariant* {: .copyable }

The optional parameter can be used to specify a Player Variant. 0 = Player, 1 = Co-Op-BabyReturning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

33

MC_PRE_PLAYER_COLLISIONFunction Args: (EntityPlayer, Collider [Entity], Low [bool])Optional callback Args: PlayerVariant* {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). The optional parameter can be used to specify a Player Variant. 0 = Player, 1 = Co-Op-Baby This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback unless its absolutely nessesary!

{: .abp .tooltip .badge }

34

MC_POST_PICKUP_INITFunction Args: (EntityPickup)Optional callback Args: PickupVariant {: .copyable }

Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityPickup. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

35

MC_POST_PICKUP_UPDATEFunction Args: (EntityPickup)Optional callback Args: PickupVariant {: .copyable }

Returning any value will have no effect on later callback executions. This callback will be called on the 1st frame that the entity exists. It will only be called on the 0th frame, when you enter a room that already contains a spawned pickup.

{: .abp .tooltip .badge }

36

MC_POST_PICKUP_RENDERFunction Args: (EntityPickup, RenderOffset [Vector])Optional callback Args: PickupVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

37

MC_POST_PICKUP_SELECTIONFunction Args: (EntityPickup, Variant [int], Subtype [int]) {: .copyable }

Called after a Pickup was choosen from a list of random pickups to be spawned.Return nil to continue with default game code. Return a table { Variant, Subtype } to override the specified values. This does also affect later executed callbacks.Returning a value that is not a table or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values EntityPickup does contain the Type/variant of the pickup to spawn, but is otherwise an empty class with empty / zeroed values. This Callback is also called when entering a room that contains pickups that are already selected. It is also called when the player drops a card. Those facts make this callback useless to use for handling pickup pools.

{: .abp .tooltip .badge }

38

MC_PRE_PICKUP_COLLISIONFunction Args: (EntityPickup, Collider [Entity], Low [bool])Optional callback Args: PickupVariant {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback without defining an PickupVariant unless its absolutely nessesary!

{: .abp .tooltip .badge }

39

MC_POST_TEAR_INITFunction Args: (EntityTear)Optional callback Args: TearVariant {: .copyable }

Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityTear. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

40

MC_POST_TEAR_UPDATEFunction Args: (EntityTear)Optional callback Args: TearVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

41

MC_POST_TEAR_RENDERFunction Args: (EntityTear, RenderOffset [Vector])Optional callback Args: TearVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

42

MC_PRE_TEAR_COLLISIONFunction Args: (EntityTear, Collider [Entity], Low [bool])Optional callback Args: TearVariant {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback without defining an PickupVariant unless its absolutely nessesary!

{: .abp .tooltip .badge }

43

MC_POST_PROJECTILE_INITFunction Args: (EntityProjectile)Optional callback Args: ProjectileVariant {: .copyable }

Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityProjectile. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

44

MC_POST_PROJECTILE_UPDATEFunction Args: (EntityProjectile)Optional callback Args: ProjectileVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

45

MC_POST_PROJECTILE_RENDERFunction Args: (EntityProjectile, RenderOffset [Vector])Optional callback Args: ProjectileVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

46

MC_PRE_PROJECTILE_COLLISIONFunction Args: (EntityProjectile, Collider [Entity], Low [bool])Optional callback Args: ProjectileVariant {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback without defining an ProjectileVariant unless its absolutely nessesary!

{: .abp .tooltip .badge }

47

MC_POST_LASER_INITFunction Args: (EntityLaser)Optional callback Args: LaserVariant {: .copyable }

Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityLaser. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

48

MC_POST_LASER_UPDATEFunction Args: (EntityLaser)Optional callback Args: LaserVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

49

MC_POST_LASER_RENDERFunction Args: (EntityLaser, RenderOffset [Vector])Optional callback Args: LaserVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

50

MC_POST_KNIFE_INITFunction Args: (EntityKnife)Optional callback Args: KnifeSubType * {: .copyable }

Returning any value will have no effect on later callback executions. The optional parameter is a SubType and NOT a Variant! This Callback provides incomplete data in the EntityKnife. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

51

MC_POST_KNIFE_UPDATEFunction Args: (EntityKnife)Optional callback Args: KnifeSubType * {: .copyable }

Returning any value will have no effect on later callback executions. The optional parameter is a SubType and NOT a Variant!

{: .abp .tooltip .badge }

52

MC_POST_KNIFE_RENDERFunction Args: (EntityKnife, RenderOffset [Vector])Optional callback Args: KnifeSubType * {: .copyable }

Returning any value will have no effect on later callback executions. The optional parameter is a SubType and NOT a Variant!

{: .abp .tooltip .badge }

53

MC_PRE_KNIFE_COLLISIONFunction Args: (EntityKnife, Collider [Entity], Low [bool])Optional callback Args: KnifeSubType * {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). The optional parameter is a SubType and NOT a Variant! This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback without defining an KnifeSubType unless its absolutely nessesary!

{: .abp .tooltip .badge }

54

MC_POST_EFFECT_INITFunction Args: (EntityEffect)Optional callback Args: EffectVariant {: .copyable }

Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityEffect. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

55

MC_POST_EFFECT_UPDATEFunction Args: (EntityEffect)Optional callback Args: EffectVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

56

MC_POST_EFFECT_RENDERFunction Args: (EntityEffect, RenderOffset [Vector])Optional callback Args: EffectVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

57

MC_POST_BOMB_INITFunction Args: (EntityBomb)Optional callback Args: BombVariant {: .copyable }

Returning any value will have no effect on later callback executions. This Callback provides incomplete data in the EntityBomb. For example, the Position is always equal to Vector(0,0).

{: .abp .tooltip .badge }

58

MC_POST_BOMB_UPDATEFunction Args: (EntityBomb)Optional callback Args: BombVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

59

MC_POST_BOMB_RENDERFunction Args: (EntityBomb, Offset [Vector])Optional callback Args: BombVariant {: .copyable }

Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

60

MC_PRE_BOMB_COLLISIONFunction Args: (EntityBomb, Collider [Entity], Low [bool])Optional callback Args: BombVariant {: .copyable }

The Low value is true, when the entity collided with the collider first. Its false if the collider collides first.Return true to ignore collision, false to collide but not execute internal code and nil to continue with internal code (example: taking damage on contact). This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback unless its absolutely nessesary!

{: .abp .tooltip .badge }

61

MC_POST_FIRE_TEARFunction Args: (EntityTear) {: .copyable }

Called when the player fires a tear.It is not called for other weapons or tears fired with Incubus.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

62

MC_PRE_GET_COLLECTIBLEFunction Args:(ItemPoolType, Decrease [bool], Seed [int]) {: .copyable }

This callback is called when the game needs to get a new random item from an item pool. You can return an integer from this callback in order to change the returned collectible type. It is not called for "scripted" drops (like Mr. Boom from Wrath) and manually spawned items.Returned values will not alter args of later executed callbacks.Returning a value that is not an integer or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values

{: .abp .tooltip .badge }

63

MC_POST_GET_COLLECTIBLEFunction Args:(SelectedCollectible [CollectibleType], ItemPoolType, Decrease [bool], Seed [int]) {: .copyable }

This function is called right after MC_PRE_GET_COLLECTIBLE and determines the Collectible that will be spawned from the given ItemPoolType. You can return an integer from this callback in order to change the returned collectible type.Returned values will not update the "SelectedCollectible" arg of later executed callbacks.Returning a value that is not an integer or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values

{: .abp .tooltip .badge }

64

MC_GET_PILL_COLORFunction Args:(Seed [int]) {: .copyable }

This function is called, when the game is spawning a pill and needs to determine its PillColor. Return a PillColor to specify a Pillcolor that needs to be choosen. Return nothing to let it be handled by the game.Returned values will not alter the args of later executed callbacks.Returning a value that is not an integer or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values

{: .abp .tooltip .badge }

65

MC_GET_PILL_EFFECTFunction Args: (SelectedPillEffect [PillEffect], PillColor) {: .copyable }

Called every frames when the game get the PillEffect of a pill. The effect of the pill can be choosed by returning the chosen PillEffect. The effect is applied to every pill of the same PillColor, not to a single pill.Returned values will not update the "SelectedPillEffect" arg of later executed callbacks.Returning a value that is not an integer or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values This code turn "Bad Trip" pills into "Balls of Steel" pills. function mod:getPillEffect(pillEffect, pillColor) if pillEffect == PillEffect.PILLEFFECT_BAD_TRIP then return PillEffect.PILLEFFECT_BALLS_OF_STEEL end end mod:AddCallback(ModCallbacks.MC_GET_PILL_EFFECT, mod.getPillEffect)

{: .abp .tooltip .badge }

66

MC_GET_TRINKETFunction Args: (SelectedTrinket [TrinketType], RNG) {: .copyable }

Called when a TrinketType of a Trinket needs to be determined. A TrinketType can be returned to change the SelectedTrinket.Returned values will not update the "SelectedTrinket" arg of later executed callbacks.Returning a value that is not an integer or nil will cause the game to crash. The last callback to return a valid return value wins out and overwrites previous callbacks' return values

{: .abp .tooltip .badge }

67

MC_POST_ENTITY_REMOVEFunction Args: (Entity)Optional callback Args: EntityType {: .copyable }

Called whenever an Entity gets removed by the game. This includes deaths, kills, removals and even unloading an entity on room transition or ending a run.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

68

MC_POST_ENTITY_KILLFunction Args: (Entity)Optional callback Args: EntityType {: .copyable }

Called right before a death animation is triggered for an Entity.Returning any value will have no effect on later callback executions.

{: .abp .tooltip .badge }

69

MC_PRE_NPC_UPDATEFunction Args: (EntityNPC)Optional callback Args: EntityType {: .copyable }

Return true if the internal AI of an NPC should be ignored, false or nil/nothing otherwise. This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback unless its absolutely nessesary!

{: .abp .tooltip .badge }

70

MC_PRE_SPAWN_CLEAN_AWARDFunction Args: (RNG, SpawnPosition [Vector]) {: .copyable }

This function is triggered in every room that can be cleared, including boss and angel rooms, and even when it normally would not spawn a reward.This Callback also handles special spawns like the spawning of Trapdoors after a boss is killed, therefore returning true here will also cancel those events.Return true if the spawn routine should be ignored, false or nil/nothing otherwise. This Callback can only be used ONCE across all mods! It is highly recommended to not use this Callback unless its absolutely nessesary!

{: .abp .tooltip .badge }

71

MC_PRE_ROOM_ENTITY_SPAWNFunction Args: (EntityType, Variant [int], SubType [int], GridIndex [int], Seed [int]) {: .copyable }

This is called when entering a new room, before spawning entities which are part of its layout. Grid entities will also trigger this callback and their type will the same as the type used by the gridspawn command. Because of this, effects are assigned the type 999 instead of 1000 in this callback. Optional: Return a table with new values { Type, Variant, Subtype }. Returning such a table will override any replacements that might naturally occur i.e. enemy variants.Returning any value will have no effect on later callback executions.

Last updated