Collectibles
Functions
Section titled “Functions”clearCollectibleSprite()
Section titled “clearCollectibleSprite()”clearCollectibleSprite(
collectible):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:80
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”void
collectibleHasCacheFlag()
Section titled “collectibleHasCacheFlag()”collectibleHasCacheFlag(
collectibleOrCollectibleType,cacheFlag):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:92
Helper function to check in the item config if a given collectible has a given cache flag.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
cacheFlag
Section titled “cacheFlag”CacheFlagValue
Returns
Section titled “Returns”boolean
collectibleSpriteEquals()
Section titled “collectibleSpriteEquals()”collectibleSpriteEquals(
sprite1,sprite2):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:110
Helper function to check if two collectible sprites have the same sprite sheet loaded.
Parameters
Section titled “Parameters”sprite1
Section titled “sprite1”Sprite
sprite2
Section titled “sprite2”Sprite
Returns
Section titled “Returns”boolean
getCollectibleChargeType()
Section titled “getCollectibleChargeType()”getCollectibleChargeType(
collectibleOrCollectibleType):ItemConfigChargeType
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:141
Helper function to get the charge type that a collectible has. Returns
ItemConfigChargeType.NORMAL if the provided collectible type was not valid.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”ItemConfigChargeType
getCollectibleDescription()
Section titled “getCollectibleDescription()”getCollectibleDescription(
collectibleOrCollectibleType):string
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:163
Helper function to get the in-game description for a collectible. Returns “Unknown” if the provided collectible type was not valid.
This function works for both vanilla and modded collectibles.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”string
getCollectibleDevilCoinPrice()
Section titled “getCollectibleDevilCoinPrice()”getCollectibleDevilCoinPrice(
collectibleOrCollectibleType):int
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:191
Helper function to get the coin cost that a collectible item would be if it were being offered in
a Devil Room deal. Returns 0 if passed CollectibleType.NULL.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”int
getCollectibleDevilHeartPrice()
Section titled “getCollectibleDevilHeartPrice()”getCollectibleDevilHeartPrice(
collectibleOrCollectibleType,player):PickupPrice
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:215
Helper function to get the heart cost that a collectible item would be if it were being offered
in a Devil Room deal. Returns 0 if passed CollectibleType.NULL.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”PickupPrice
getCollectibleGfxFilename()
Section titled “getCollectibleGfxFilename()”getCollectibleGfxFilename(
collectibleOrCollectibleType):string
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:259
Helper function to get the path to a collectible PNG file. Returns the path to the question mark sprite (i.e. from Curse of the Blind) if the provided collectible type was not valid.
If you intentionally want the path to the question mark sprite, pass -1 as the collectible type.
Note that this does not return the file name, but the full path to the collectible’s PNG file.
The function is named “GfxFilename” to correspond to the associated ItemConfigItem.GfxFileName
field.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup | -1
Returns
Section titled “Returns”string
getCollectibleInitCharge()
Section titled “getCollectibleInitCharge()”getCollectibleInitCharge(
collectibleOrCollectibleType):int
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:288
Helper function to get the initial amount of charges that a collectible has. In most cases, when
picking up an active collectible for the first time, it will be fully charged, which corresponds
to an InitCharge value of -1. However, in some cases, this may be different. For example,
Eden’s Soul starts without any charges, so it has an InitCharge value of 0.
This function returns 0 if the provided collectible type was not valid. This function returns -1 if the provided collectible type was not an active collectible.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”int
getCollectibleItemType()
Section titled “getCollectibleItemType()”getCollectibleItemType(
collectibleOrCollectibleType):ItemType
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:308
Helper function to get the ItemType of a collectible. Returns ItemType.ITEM_NULL if the
provided collectible type was not valid.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”ItemType
getCollectibleMaxCharges()
Section titled “getCollectibleMaxCharges()”getCollectibleMaxCharges(
collectibleOrCollectibleType):int
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:328
Helper function to get the maximum amount of charges that a collectible has. Returns 0 if the provided collectible type was not valid.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”int
getCollectibleName()
Section titled “getCollectibleName()”getCollectibleName(
collectibleOrCollectibleType):string
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:352
Helper function to get the name of a collectible. Returns “Unknown” if the provided collectible type is not valid.
This function works for both vanilla and modded collectibles.
For example, getCollectibleName(CollectibleType.SAD_ONION) would return “Sad Onion”.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”string
getCollectiblePedestalType()
Section titled “getCollectiblePedestalType()”getCollectiblePedestalType(
collectible):CollectiblePedestalType
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:380
Helper function to get the “pedestal type” of a collectible. For example, it might be sitting on top of a broken Blood Donation Machine, or it might be sitting on top of an opened Spiked Chest.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”CollectiblePedestalType
getCollectibleQuality()
Section titled “getCollectibleQuality()”getCollectibleQuality(
collectibleOrCollectibleType):Quality
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:399
Helper function to get a collectible’s quality, which ranges from 0 to 4 (inclusive). For example, Mom’s Knife has a quality of 4. Returns 0 if the provided collectible type was not valid.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”Quality
getCollectibleTags()
Section titled “getCollectibleTags()”getCollectibleTags(
collectibleOrCollectibleType):BitFlags<ItemConfigTagValue>
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:426
Helper function to get the tags of a collectible (which is the composition of zero or more
ItemConfigTag). Returns 0 if the provided collectible type is not valid.
For example:
const collectibleType = CollectibleType.SAD_ONION;const itemConfigTags = getCollectibleTags(collectibleType); // itemConfigTags is "18350080"Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”BitFlags<ItemConfigTagValue>
getVanillaCollectibleTypesOfQuality()
Section titled “getVanillaCollectibleTypesOfQuality()”getVanillaCollectibleTypesOfQuality(
quality): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:444
Returns an array containing every vanilla collectible type with the given quality.
Note that this function will only return vanilla collectible types. To handle modded collectible
types, use the getCollectibleTypesOfQuality helper function instead.
Parameters
Section titled “Parameters”quality
Section titled “quality”Quality
Returns
Section titled “Returns”readonly CollectibleType[]
isActiveCollectible()
Section titled “isActiveCollectible()”isActiveCollectible(
collectibleType):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:458
Returns true if the item type in the item config is equal to ItemType.ACTIVE.
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”boolean
isBlindCollectible()
Section titled “isBlindCollectible()”isBlindCollectible(
collectible):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:469
Returns true if the collectible has a red question mark sprite.
Note that this function will not work properly in a render callback with the RenderMode set to
RenderMode.WATER_REFLECT. If this is detected, this function will throw a run-time error.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”boolean
isFamiliarCollectible()
Section titled “isFamiliarCollectible()”isFamiliarCollectible(
collectibleType):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:494
Returns true if the item type in the item config is equal to ItemType.FAMILIAR.
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”boolean
isGlitchedCollectible()
Section titled “isGlitchedCollectible()”isGlitchedCollectible(
collectible):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:508
Returns whether the given collectible is a “glitched” item. All items are replaced by glitched items once a player has TMTRAINER. However, glitched items can also “naturally” appear in secret rooms and I AM ERROR rooms if the “Corrupted Data” achievement is unlocked.
Under the hood, this checks if the sub-type of the collectible is greater than 4,000,000,000.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”boolean
isHiddenCollectible()
Section titled “isHiddenCollectible()”isHiddenCollectible(
collectibleOrCollectibleType):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:520
Returns true if the collectible has the “Hidden” attribute in the item config.
Hidden collectibles will not show up in any pools and Eden will not start with them.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”boolean
isModdedCollectibleType()
Section titled “isModdedCollectibleType()”isModdedCollectibleType(
collectibleType):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:532
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”boolean
isPassiveOrFamiliarCollectible()
Section titled “isPassiveOrFamiliarCollectible()”isPassiveOrFamiliarCollectible(
collectibleOrCollectibleType):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:542
Returns true if the item type in the item config is equal to ItemType.ITEM_PASSIVE or
ItemType.ITEM_FAMILIAR.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
Returns
Section titled “Returns”boolean
isQuality()
Section titled “isQuality()”isQuality(
collectibleOrCollectibleType,quality):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:555
Helper function to check if a collectible type is a particular quality.
Parameters
Section titled “Parameters”collectibleOrCollectibleType
Section titled “collectibleOrCollectibleType”CollectibleType | EntityPickup
quality
Section titled “quality”int
Returns
Section titled “Returns”boolean
isSingleUseCollectible()
Section titled “isSingleUseCollectible()”isSingleUseCollectible(
collectibleType):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:568
Helper function to determine if a particular collectible will disappear from the player’s inventory upon use. Note that this will not work will modded collectibles, as there is no way to dynamically know if a modded collectible will disappear.
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”boolean
isValidCollectibleType()
Section titled “isValidCollectibleType()”isValidCollectibleType(
collectibleType):collectibleType is CollectibleType
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:574
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”int
Returns
Section titled “Returns”collectibleType is CollectibleType
isVanillaCollectibleType()
Section titled “isVanillaCollectibleType()”isVanillaCollectibleType(
collectibleType):boolean
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:582
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”boolean
newCollectibleSprite()
Section titled “newCollectibleSprite()”newCollectibleSprite(
collectibleType):Sprite
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:594
Helper function to generate a new sprite based on a collectible. If the provided collectible type is invalid, a sprite with a Curse of the Blind question mark will be returned.
If you intentionally want a question mark sprite, pass -1 as the collectible type.
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType | -1
Returns
Section titled “Returns”Sprite
preventCollectibleRotation()
Section titled “preventCollectibleRotation()”preventCollectibleRotation(
collectible):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:622
Helper function to remove the rotation behavior from a collectible. This will happen by default when collectibles are spawned when playing as Tainted Isaac or when having Binge Eater.
Under the hood, this is accomplished by morphing the collectible with the ignoreModifiers
argument set to true.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”void
removeCollectiblePickupDelay()
Section titled “removeCollectiblePickupDelay()”removeCollectiblePickupDelay(
collectible):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:644
Helper function to remove all pickup delay on a collectible. By default, collectibles have a 20 frame delay before they can be picked up by a player.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”void
setCollectibleBlind()
Section titled “setCollectibleBlind()”setCollectibleBlind(
collectible):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:659
Helper function to set a collectible sprite to a question mark (i.e. how collectibles look when the player has Curse of the Blind).
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”void
setCollectibleEmpty()
Section titled “setCollectibleEmpty()”setCollectibleEmpty(
collectible):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:677
Helper function to remove the collectible from a collectible pedestal and make it appear as if a
player has already taken the item. This is accomplished by changing the sub-type to
CollectibleType.NULL and then setting the sprite to an empty/missing PNG file.
For more information, see the documentation for the “clearSprite” helper function.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”void
setCollectibleGlitched()
Section titled “setCollectibleGlitched()”setCollectibleGlitched(
collectible):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:693
Helper function to change a collectible into a “glitched” item (like the ones that appear when the player has TMTRAINER).
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
Returns
Section titled “Returns”void
setCollectiblePedestalType()
Section titled “setCollectiblePedestalType()”setCollectiblePedestalType(
collectible,collectiblePedestalType):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:723
Helper function to set the “pedestal type” of a collectible. For example, it might be sitting on top of a broken Blood Donation Machine and you want to change it to be sitting on top of an opened Spiked Chest.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
collectiblePedestalType
Section titled “collectiblePedestalType”CollectiblePedestalType
Returns
Section titled “Returns”void
setCollectibleSprite()
Section titled “setCollectibleSprite()”setCollectibleSprite(
collectible,pngPath):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:751
Helper function to change the sprite of a collectible pedestal entity.
For more information about removing the collectible sprite, see the documentation for the “clearSprite” helper function.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
The collectible whose sprite you want to modify.
pngPath
Section titled “pngPath”string | undefined
Equal to either the spritesheet path to load (e.g. “gfx/items/collectibles/collectibles_001_thesadonion.png”) or undefined. If undefined, the sprite will be removed, making it appear like the collectible has already been taken by the player.
Returns
Section titled “Returns”void
setCollectiblesRerolledForItemTracker()
Section titled “setCollectiblesRerolledForItemTracker()”setCollectiblesRerolledForItemTracker():
void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:781
Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that the build has been rerolled.
Returns
Section titled “Returns”void
setCollectibleSubType()
Section titled “setCollectibleSubType()”setCollectibleSubType(
collectible,newCollectibleType):void
Defined in: packages/isaacscript-common/src/functions/collectibles.ts:792
Helper function to change the collectible on a pedestal. Simply updating the SubType field is
not sufficient because the sprite will not change.
Parameters
Section titled “Parameters”collectible
Section titled “collectible”EntityPickup
newCollectibleType
Section titled “newCollectibleType”CollectibleType
Returns
Section titled “Returns”void
