Binding of Isaac: Rebirth Wiki
Advertisement

A list of Lua classes in the Modding API of The Binding of Isaac: Afterbirth †.

Config

CppContainer

PlayerTypes

Color

Entity

AddSlowing()
Entity:AddSlowing( EntityRef Source, Integer Duration, float SlowValue, Color SlowColor )
Description
Adds Slow Status Effect to Entity.
Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
float SlowValue
The amount of slowing.
Color SlowColor
What Color the effect will be.
None.
Examples
None.
AddPoison()
Entity:AddPoison( EntityRef Source, Integer Duration, float Damage )
Description
Adds a Poison Effect to Entity.
As of 17th January 2017 this function ignores the Duration and Damage arguments. It does damage based on player damage during a fixed amount of time.
Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
float Damage
How much poison damage it gives.
None.
Examples
None.
AddMidasFreeze()
Entity:AddMidasFreeze( EntityRef Source, Integer Duration )
Description
Adds Midas's Freeze Effect to Entity.
Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
None.
Examples
None.
AddFreeze()
Entity:AddFreeze( EntityRef Source, Integer Duration )
Description
Adds a Freeze Effect to Entity.
Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
None.
Examples
None.
AddShrink()
Entity:AddShrink( EntityRef Source, Integer Duration )
Description
Shrinks the Entity.
Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
None.
Examples
None.
AddHealth()
Entity:AddHealth( float HitPoints )
Description
Adds Health to the Entity.
Arguments Returns
float HitPoints
The Amount of HP added to the Entity.
None.
Examples
None.
AddFear()
Entity:AddFear( EntityRef Source, Integer Duration )
Description
Adds a Fear Effect to Entity.
Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
None.
Examples
None.
AddConfusion()
Entity:AddConfusion( EntityRef Source, Integer Duration Boolean IgnoreBosses )
Description
Confuses the Entity.
Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
boolean IgnoreBosses
If the effect should be working on bosses or not.
None.
Examples
None.
AddCharmed()
Entity:AddCharmed( Integer Duration )
Description
Adds a Charm Effect to Entity.
Arguments Returns
Integer Duration
For how long the Status Effect is active in frames.
None.
Examples
None.
AddBurn()
Entity:AddBurn( EntityRef Source, Integer Duration float Damage )
Description
Adds a Burn Effect to Entity.

As of 17th January 2017 this function ignores the Duration and Damage arguments. It does damage based on player damage during a fixed amount of time.

Arguments Returns
EntityRef Source
The Entity that the code is referencing to.
Integer Duration
For how long the Status Effect is active in frames.
float Damage
How much burn damage it gives.
None.
Examples
None.
AddEntityFlags()
Entity:AddBurn( Integer Flags )
Description
Adds flags to the Entity.
Arguments Returns
Integer Flags
The flag that you wanna add to the entity (Example: FLAG_SPAWN_BLACK_HP) .
None.
Examples
None.

EntityBomb

SetExplosionCountdown()
EntityBomb::SetExplosionCountdown( integer Countdown )
Description
Sets the amount of time before the bomb explodes.
Arguments Returns
integer Countdown
The amount of time before the bomb explodes.
None.
Examples
None.

EntityEffect

FollowParent()
EntityEffect::FollowParent( entity Parent )
Description
Has a familiar or other entity follow a specified parent.
Arguments Returns
entity Parent
Defines which entity to follow.
None.
Examples
None.
IsPlayerCreep()
boolean EntityEffect:IsPlayerCreep( int variant )
Description
Returns whether a piece of creep is from the player or an entity.
Arguments Returns
float HitPoints
The Amount of HP added to the Entity.
Boolean isPlayerCreep
Determines whether the creep is the player's (true) or not (false).
Examples
None.
SetDamageSource()
EntityEffect::SetDamageSource( EntityType DamageSource )
Description
Determines what kind of damage was taken. Useful for making items that deal certain special kinds of damage (Fire Mind, Scorpio).
Arguments Returns
EntityType DamageSource
Determines the type of damage dealt.
None.
Examples
None.
SetRadii()
EntityEffect::SetRadii( float min, float max )
Description
Used to determine the minimum and maximum radius of shockwaves (shockwaves are the circular knockback most commonly applied by farts).
Arguments Returns
float min
Defines the minimum knockback.
float max
Defines the maximum knockback.
None.
Examples
None.
SetTimeout()
EntityEffect::SetTimeout( integer Timeout )
Description
Currently unknown.
Arguments Returns
integer Timeout
Currently unknown.
None.
Examples
None.

EntityFamiliar

EntityKnife

EntityLaser

EntityNPC

EntityPickup

EntityPlayer

AddBlackHearts()
Player:AddBlackHearts( integer BlackHearts )
Description
Adds Black Hearts to Isaac
Arguments Returns
Integer BlackHearts
Number of Black Hearts to add.
None.
Examples
Example 1
Adds 2 Black Hearts to Isaac.
player = Isaac.GetPlayer( 0 )
player:AddBlackHearts( 2 )
AddBlueFlies()
Entity: or Player:AddBlueFlies( integer Amount, Vector Position, Entity Target )
Description
Spawns blue flies in a specified position, targeting a specified enemy.
Arguments Returns
Integer Amount
Number of Blue Flies to add.
Vector Position
Coordinates where Blue Flies should spawn
Entity Target
Entity the Blue Flies should target.
None.
Examples
Example 1
Spawns 5 Blue Flies whenever Isaac attacks an enemy
local exampleMod = RegisterMod("AddBlueFlies Example", 1)

function exampleMod:update( target , amount, source, dealer )
  local player = Isaac.GetPlayer( 0 )
  if source == 0 and target:IsActiveEnemy() then
    player = player:AddBlueFlies(5, player.Position, target )
  end
end

exampleMod:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, exampleMod.update);
AddBlueSpider()
Entity: or Player:AddBlueSpider( Vector Position )
Description
Spawns a Blue Spider in a specified position.
Arguments Returns
Vector Position
Coordinates where Blue Spider should spawn.
None.
Examples
Example 1
Spawns a Blue Spider at Isaac's position
player = Isaac.GetPlayer( 0 )
player = player:AddBlueSpider( player.Position )
AddMaxHearts()
Player:AddMaxHearts( Integer MaxHearts, Boolean IgnoreKeeper )
Description
Adds Heart Containers to Isaac.
Arguments Returns
Integer MaxHearts
The amount of Heart Containers you want to add.
Boolean IgnoreKeeper
If usable by the Keeper.
None.
Examples
None.
GetHearts()
Player:GetHearts()
Description
Get the number of red half-hearts the player has.
Arguments Returns
None. Integer Hearts
Number of Red Hearts Isaac has. Note that each half heart counts as one.
Examples
None.
GetSoulHearts()
Player:GetSoulHearts()
Description
Get the number of combined soul and black half-hearts.
Arguments Returns
None. Integer SoulHearts
Number of Soul Hearts and Black Hearts Isaac has. Note that each half heart counts as one.
Examples
None.
GetBlackHearts()
Player:GetBlackHearts()
Description
Get which of the soul half-hearts is really a black half-heart.
Arguments Returns
None. Integer BlackHearts
A bit mask of the black half-hearts among the soul half-hearts. The lowest bit (1) represents the first soul half-heart, and the highest bit represents the highest soul half-heart.
Examples
None.
GetName()
Player:GetName()
Description
Get the name of the player
Arguments Returns
None. String Name
A string that represents the name of the character you are playing as.
Examples
Example 1
Prints out the name of the character in the debug console.
player = Isaac.GetPlayer(0)
Isaac.DebugString(player:GetName())
AddNullCostume()
Player:AddNullCostume(Config::NullItemID NullId)
Description
Adds a costume to the player
Arguments Returns
integer CostumeID
The id of the costume to add.
None.
Examples
Example 1
Adds a custom made costume to the player upon picking up the item.
local costume = {}
local custom_costume = Isaac.GetCostumeIdByPath("gfx/characters/costume.anm2")
function afterlife:playerFrameUpdate(_player)
  if game:GetFrameCount() == 1 then
    setCostume(custom_costume, false)
  end
  if not hasCostume(markOfCain_costume) and _player:HasCollectible(markOfCain_item) then
    _player:AddNullCostume(custom_costume)
    setCostume(custom_costume, true)
  end
end

function hasCostume(_costume)
  if costume[_costume] ~= nil then
    return costume[_costume]
  else
    return false
  end
end

function setCostume(_costume, _value)
  costume[_costume] = _value
end

afterlife:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, afterlife.playerFrameUpdate)

EntityPtr

EntityRef

Game

GridEntity

GridEntityDesc

GridEntityDoor

Level

PathFinder

ProjectileParams

RNG

GetSeed()
RNG::GetSeed()
Description
Gets and returns the seed to be used in the run.
Arguments Returns
None. double Seed
An 8-digit number that generates the run.
Examples
None.
Next()
RNG::Next()
Description
Unkown.
Arguments Returns
None. None.
Examples
None.
RandomFloat()
RNG::RandomFloat()
Description
Makes and returns a random float value.
Arguments Returns
None. float Float
The random float value.
Examples
None.
RandomInt()
RNG::RandomInt( integer Max )
Description
Makes and returns a random Integer value.
Arguments Returns
integer Max
The maximum integer it will generate.
int Int
The random integer value.
Examples
None.

Room

Sprite

TearParams

TemporaryEffect

TemporaryEffects

AddCollectibleEffect()
TemporaryEffects::AddCollectibleEffect( CollectibleType CollectibleType, boolean AddCostume )
Description
Adds an effect from picking up a collectible.
Arguments Returns
CollectibleType CollectibleType
Checks the kind of collectible you are picking up.
boolean AddCostume
Checks whether Isaac's sprite needs to update with a new costume.
None.
Examples
None.
AddNullEffect()
TemporaryEffects::AddNullEffect( Config::NullItemID NullId, boolean AddCostume )
Description
Unclear. Possibly deals with items that do nothing but add a costume effect?
Arguments Returns
Config::NullItemID NullId
Calls a NullId from the Config class.
boolean AddCostume
Checks whether Isaac's sprite needs to update with a new costume.
None.
Examples
None.
AddTrinketEffect()
TemporaryEffects::AddTrinketEffect( TrinketType TrinketType, boolean AddCostume )
Description
Adds an effect from picking up a trinket.
Arguments Returns
TrinketType TrinketType
Checks what trinket is being picked up.
boolean AddCostume
Checks whether Isaac's sprite needs to update with a new costume.
None.
Examples
None.
ClearEffects()
TemporaryEffects::ClearEffects()
Description
Clears effects on a character. Likely used for Dice rooms and the D4.
Arguments Returns
None. None.
Examples
None.

Vector


Advertisement