The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

Immortal Hearts
Rokk  [developer] 4 Dec, 2021 @ 7:07am
API Docs
After several requests for an API, the latest update added an API of sorts, for other mod makers to interface with this mod.

void ImmortalHeartsAPI.SetFlyHeartConversionEnabled(bool enabled)
Enables/disables the mechanic where immortal hearts turn into flies for The Lost/Keeper. By default this is enabled.

table ImmortalHeartsAPI.GetPlayerImmortalHearts()
Returns a table that contains the immortal heart data for all players. For more info on how this table is structured, see the comments in main.lua (line 90).

void ImmortalHeartsAPI.SpawnImmortalHeart(Vector? position, Vector? velocity)
Spawns an immortal heart at the specified position and velocity.
If the arguments are nil, the player position and a 0 velocity are used.

int ImmortalHeartsAPI.GetImmortalHeartEntityVariant()
Returns the pickup variant for immortal hearts. This variable is the result of the Immortal Hearts mod calling Isaac.GetEntityVariantByName("Immortal Heart").

int ImmortalHeartsAPI.GetImmortalHeartPickupSoundId()
Returns the sound ID for the immortal heart pickup sound. This variable is the result of the Immortal Hearts mod calling Isaac.GetSoundIdByName("ImmortalHeart_Pickup").

int ImmortalHeartsAPI.GetImmortalHeartRefillSoundId()
Returns the sound ID for the immortal heart refill sound. This variable is the result of the Immortal Hearts mod calling Isaac.GetSoundIdByName("ImmortalHeart_Refill").

Example usage:
if ImmortalHeartsAPI then ImmortalHeartsAPI.SpawnImmortalHeart() end
This example code will spawn an immortal heart at player 0's position. ImmortalHeartsAPI is a global variable, and you should check if it exists before trying to use it.
Last edited by Rokk; 4 Dec, 2021 @ 7:09am
< >
Showing 1-1 of 1 comments
Rokk  [developer] 4 Dec, 2021 @ 7:09am 
If you are a mod developer and need something exposed or added, feel free to request it here.
< >
Showing 1-1 of 1 comments
Per page: 1530 50