Player Collectible Tracking
Classes
Section titled “Classes”PlayerCollectibleTracking
Section titled “PlayerCollectibleTracking”Defined in: packages/isaacscript-common/src/classes/features/other/PlayerCollectibleTracking.ts:21
Extends
Section titled “Extends”Feature
Methods
Section titled “Methods”getPlayerCollectibleTypes()
Section titled “getPlayerCollectibleTypes()”getPlayerCollectibleTypes(
player,includeActiveCollectibles?): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/PlayerCollectibleTracking.ts:92
Helper function to get all of the collectible types that the player has gotten so far on this run, in order.
In the case of items given on the first frame of the run or the case where the player rerolls
their build in the middle of the run (e.g. with D4), the order of the collectible types will
not correspond to the order that the items were actually given to the player. In this case, the
order will be from the lowest CollectibleType to the highest.
Under the hood, this feature works by tracking the number of collectibles that a player has on every frame. Thus, in a situation where a collectible was both added and removed to the player on the same frame, the amount of total collectibles would stay the same, and the collectible types would not be updated. In vanilla, this situation would never happen, but another mod might do this for some reason. (With that said, the next time that a collectible is normally added or removed, it would trigger a re-scan, and the previous changes would be picked up.)
In order to use this function, you must upgrade your mod with
ISCFeature.PLAYER_COLLECTIBLE_TRACKING.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
The player to get the collectible types for.
includeActiveCollectibles?
Section titled “includeActiveCollectibles?”boolean = true
Optional. If true, will include all active collectibles. Default is true.
Returns
Section titled “Returns”readonly CollectibleType[]
getPlayerLastPassiveCollectibleType()
Section titled “getPlayerLastPassiveCollectibleType()”getPlayerLastPassiveCollectibleType(
player):CollectibleType|undefined
Defined in: packages/isaacscript-common/src/classes/features/other/PlayerCollectibleTracking.ts:123
Helper function to get the last passive collectible type that the player picked up. In most cases, this will be the passive that would be removed if the player used Clicker.
Returns undefined if the player does not have any passive collectibles.
In order to use this function, you must upgrade your mod with
ISCFeature.PLAYER_COLLECTIBLE_TRACKING.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”CollectibleType | undefined
