Major changes are coming to the Wiki! To learn more and let your voice be heard, please go here.

Additionally, we are currently experiencing some bugs and glitches. We're working on fixing them, but please be aware this means certain images, such as the collection grid for items, will be replaced by errors for the time being.

Modding Callbacks

From Binding of Isaac: Rebirth Wiki
Jump to: navigation, search

Callbacks are how modders hook in to Afterbirth+ and make different functions execute. Without callbacks, there's no way to execute user code.

To add a callback, call modname:AddCallback(ModCallbacks.ENUM, fn, params)

where ENUM corresponds to the callback you'd like to hook into, fn is your function name, and params are optional extra parameters for this callback. Any name can be used for your callback function.

MC_NPC_UPDATE[edit | edit source]

Triggers when an NPC is updated. Passing an EntityType as a parameter will cause the callback to trigger only when entities of that type are updated.

The format of this callback function is: Template:ModCallback

MC_POST_UPDATE[edit | edit source]

Triggers when the game updates.

The format of this callback function is: Template:ModCallback

MC_POST_RENDER[edit | edit source]

Triggers every frame.

The format of this callback function is: Template:ModCallback

MC_USE_ITEM[edit | edit source]

Triggers when an active item is used. Passing an item ID as a parameter will cause the callback to trigger only when an item with that ID is used.

The format of this callback function is: Template:ModCallback

MC_POST_PEFFECT_UPDATE[edit | edit source]

Triggers every frame, for every player.

The format of this callback function is: Template:ModCallback

MC_USE_CARD[edit | edit source]

Triggers when a card is used. Passing a card ID as a parameter will cause the callback to trigger only when the used card has that card ID.

The format of this callback function is: Template:ModCallback

MC_FAMILIAR_UPDATE[edit | edit source]

Triggers every frame for each familiar. Passing a familiar variant will cause the callback to trigger only when that familiar updates.

The format of this callback function is: Template:ModCallback

MC_ENTITY_TAKE_DAMAGE[edit | edit source]

Triggers when an entity takes damage. Passing an entity as a parameter will cause the callback to trigger only when that entity is damaged. If an attacked entity is immune to damage, this callback will not trigger.

The format of this callback function is: Template:ModCallback


Dataminer Icon.png Modding Dataminer Icon.png

References Modding Tutorials - XML Modding - Added in Afterbirth † Lua Reference - Added in Afterbirth † Modding of Isaac Lua Reference
Tools Added in Afterbirth † Debug Console - Modding Tools - Basement Renovator
Releases Modding of Isaac - Added in Afterbirth † Steam Workshop - NexusMods
Community Modding of Isaac Subreddit - Modding of Isaac Discord Server
The Binding of Isaac: Rebirth The Binding of Isaac: Rebirth The Binding of Isaac: Rebirth
Achievements Achievements Attributes Attributes Bosses Bosses TarotCard.png Cards and Runes Challenges Challenges Chapters Chapters
Characters Characters MainPageBabies.png Co-op Items Items Item Pools Item Pools Monsters Monsters Objects Objects
Pickups Pickups Pills Pills Rooms Rooms Seeds Seeds Transformations Transformations Trinkets Trinkets