Skip to main content

Item Pool Detection

Hierarchy

  • Feature

    ItemPoolDetection

Methods

getCollectiblesInItemPool

getCollectiblesInItemPool(itemPoolType): readonly CollectibleType[]

Helper function to get the remaining collectibles in a given item pool. This function is expensive, so only use it in situations where the lag is acceptable.

In order to use this function, you must upgrade your mod with ISCFeature.ITEM_POOL_DETECTION.

Parameters

NameType
itemPoolTypeItemPoolType

Returns

readonly CollectibleType[]

Defined in

packages/isaacscript-common/src/classes/features/other/ItemPoolDetection.ts:55


isCollectibleInItemPool

isCollectibleInItemPool(collectibleType, itemPoolType): boolean

Helper function to see if the given collectible is still present in the given item pool.

If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and then changed back. (This is because Tainted Lost is not able to retrieve non-offensive collectibles from item pools).

Under the hood, this function works by using the ItemPool.AddRoomBlacklist method to blacklist every collectible except for the one provided.

In order to use this function, you must upgrade your mod with ISCFeature.ITEM_POOL_DETECTION.

Parameters

NameType
collectibleTypeCollectibleType
itemPoolTypeItemPoolType

Returns

boolean

Defined in

packages/isaacscript-common/src/classes/features/other/ItemPoolDetection.ts:79


isCollectibleUnlocked

isCollectibleUnlocked(collectibleType, itemPoolType): boolean

Helper function to see if the given collectible is unlocked on the current save file. This requires providing the corresponding item pool that the collectible is normally located in.

  • If any player currently has the collectible, then it is assumed to be unlocked. (This is because in almost all cases, when a collectible is added to a player's inventory, it is subsequently removed from all pools.)
  • If the collectible is located in more than one item pool, then any item pool can be provided.
  • If the collectible is not located in any item pools, then this function will always return false.
  • If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and then changed back. (This is because Tainted Lost is not able to retrieve non-offensive collectibles from item pools).

In order to use this function, you must upgrade your mod with ISCFeature.ITEM_POOL_DETECTION.

Parameters

NameType
collectibleTypeCollectibleType
itemPoolTypeItemPoolType

Returns

boolean

Defined in

packages/isaacscript-common/src/classes/features/other/ItemPoolDetection.ts:164