Skip to content

Collectibles

clearCollectibleSprite(collectible): void

Defined in: packages/isaacscript-common/src/functions/collectibles.ts:80

EntityPickup

void


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.

CollectibleType | EntityPickup

CacheFlagValue

boolean


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.

Sprite

Sprite

boolean


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.

CollectibleType | EntityPickup

ItemConfigChargeType


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.

CollectibleType | EntityPickup

string


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.

CollectibleType | EntityPickup

int


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.

CollectibleType | EntityPickup

EntityPlayer

PickupPrice


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.

CollectibleType | EntityPickup | -1

string


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.

CollectibleType | EntityPickup

int


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.

CollectibleType | EntityPickup

ItemType


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.

CollectibleType | EntityPickup

int


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”.

CollectibleType | EntityPickup

string


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.

EntityPickup

CollectiblePedestalType


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.

CollectibleType | EntityPickup

Quality


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"

CollectibleType | EntityPickup

BitFlags<ItemConfigTagValue>


getVanillaCollectibleTypesOfQuality(quality): readonly CollectibleType[]

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.

Quality

readonly CollectibleType[]


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.

CollectibleType

boolean


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.

EntityPickup

boolean


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.

CollectibleType

boolean


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.

EntityPickup

boolean


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.

CollectibleType | EntityPickup

boolean


isModdedCollectibleType(collectibleType): boolean

Defined in: packages/isaacscript-common/src/functions/collectibles.ts:532

CollectibleType

boolean


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.

CollectibleType | EntityPickup

boolean


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.

CollectibleType | EntityPickup

int

boolean


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.

CollectibleType

boolean


isValidCollectibleType(collectibleType): collectibleType is CollectibleType

Defined in: packages/isaacscript-common/src/functions/collectibles.ts:574

int

collectibleType is CollectibleType


isVanillaCollectibleType(collectibleType): boolean

Defined in: packages/isaacscript-common/src/functions/collectibles.ts:582

CollectibleType

boolean


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.

CollectibleType | -1

Sprite


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.

EntityPickup

void


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.

EntityPickup

void


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).

EntityPickup

void


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.

EntityPickup

void


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).

EntityPickup

void


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.

EntityPickup

CollectiblePedestalType

void


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.

EntityPickup

The collectible whose sprite you want to modify.

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.

void


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.

void


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.

EntityPickup

CollectibleType

void