Binding of Isaac - Afterbirth+ Lua Reference/Guide
ItemConfig::Config Class Reference

Public Member Functions

const ItemGetCollectible (integer ID)
 
const ItemGetTrinket (integer ID)
 
const ItemGetNullItem (integer ID)
 
const CardGetCard (integer ID)
 
const PillEffectGetPillEffect (PillEffect PillEffectID)
 
const ItemListGetCollectibles ()
 
const ItemList & GetTrinkets ()
 
const ItemList & GetNullItems ()
 
const CostumeListGetCostumes ()
 
const CardList & GetCards ()
 
const PillList & GetPillEffects ()
 

Static Public Member Functions

static boolean IsValidCollectible (CollectibleType ID)
 
static boolean ShouldAddCostumeOnPickup (Item Config)
 

Member Function Documentation

◆ GetCard()

const Card& ItemConfig::Config::GetCard ( integer  ID)

◆ GetCards()

const CardList& ItemConfig::Config::GetCards ( )

◆ GetCollectible()

const Item& ItemConfig::Config::GetCollectible ( integer  ID)

Returns the Itemobject of a given CollectibleID.

This Code gets the highest possible collectibleid including modded items. It uses the Binary Search algorithm to do it.

Using GetCollectible(): (recommended!)

function GetMaxCollectibleID()
    local id = CollectibleType.NUM_COLLECTIBLES-1
    local step = 16
    while step > 0 do
        if Isaac.GetItemConfig():GetCollectible(id+step) ~= nil then
            id = id + step
        else
            step = step // 2
        end
    end
    
    return id
end

Using GetCollectibles(): (Crashes on Mac OS)

function GetMaxCollectibleID()
    return Isaac.GetItemConfig():GetCollectibles().Size -1
end

◆ GetCollectibles()

const ItemList& ItemConfig::Config::GetCollectibles ( )

Returns the List of all Collectibles.

The objects stored in the returned list cant be accessed correctly and are therefore useless.

This Code gets the highest possible collectibleid including modded items.

function GetMaxCollectibleID()
    return Isaac.GetItemConfig():GetCollectibles().Size -1
end

◆ GetCostumes()

const CostumeList& ItemConfig::Config::GetCostumes ( )
The Vector/Table returned by this function is always empty!

◆ GetNullItem()

const Item& ItemConfig::Config::GetNullItem ( integer  ID)

◆ GetNullItems()

const ItemList& ItemConfig::Config::GetNullItems ( )

◆ GetPillEffect()

const PillEffect& ItemConfig::Config::GetPillEffect ( PillEffect  PillEffectID)

◆ GetPillEffects()

const PillList& ItemConfig::Config::GetPillEffects ( )

◆ GetTrinket()

const Item& ItemConfig::Config::GetTrinket ( integer  ID)

◆ GetTrinkets()

const ItemList& ItemConfig::Config::GetTrinkets ( )

◆ IsValidCollectible()

static boolean ItemConfig::Config::IsValidCollectible ( CollectibleType  ID)
static

Function to check if a given item id is a valid collectible id (aka. this item exists). Returns True when it exists and False when it doesnt.

This function returns false for modded items! Use itemConfig:GetCollectible() instead.
This Code checks, if the item "Sad Onion" (ID: 1) exists.
ItemConfig.Config.IsValidCollectible(1)

◆ ShouldAddCostumeOnPickup()

static boolean ItemConfig::Config::ShouldAddCostumeOnPickup ( Item  Config)
static