Skip to content

Player Collectibles

addCollectible(player, …collectibleTypes): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:20

Helper function to add one or more collectibles to a player.

This function is variadic, meaning that you can supply as many collectible types as you want to add.

EntityPlayer

…readonly CollectibleType[]

void


addCollectibleCostume(player, collectibleType): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:29

EntityPlayer

CollectibleType

void


anyPlayerHasCollectible(collectibleType, ignoreModifiers?): boolean

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:49

Helper function to check to see if any player has a particular collectible.

CollectibleType

The collectible type to check for.

boolean

If set to true, only counts collectibles the player actually owns and ignores effects granted by items like Zodiac, 3 Dollar Bill and Lemegeton. Default is false.

boolean


getActiveItemSlots(player, collectibleType): readonly ActiveSlot[]

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:64

Helper function to find the active slots that the player has the corresponding collectible type in. Returns an empty array if the player does not have the collectible in any active slot.

EntityPlayer

CollectibleType

readonly ActiveSlot[]


getAdjustedPrice(basePrice): int

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:79

Helper function to get the adjusted price for a pickup, depending on how many Steam Sales all players currently have. (For example, if Jacob has one Steam Sale and Esau has one Steam Sale, the prices for items in the shop would be the same as if Isaac had two Steam Sales.)

int

int


getPlayerCollectibleCount(player, …collectibleTypes): int

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:92

Helper function to return the total amount of collectibles that a player has that match the collectible type(s) provided.

This function is variadic, meaning that you can specify N collectible types.

Note that this will filter out non-real collectibles like Lilith’s Incubus.

EntityPlayer

…readonly CollectibleType[]

int


getPlayersWithCollectible(…collectibleTypes): readonly EntityPlayer[]

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:111

Helper function to get only the players that have a certain collectible.

This function is variadic, meaning that you can supply as many collectible types as you want to check for. It only returns the players that have all of the collectibles.

…readonly CollectibleType[]

readonly EntityPlayer[]


getTotalPlayerCollectibles(collectibleType): int

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:129

Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad Onion and player 2 has 2 Sad Onions, then this function would return 3.

Note that this will filter out non-real collectibles like Lilith’s Incubus.

CollectibleType

int


hasCollectible(player, …collectibleTypes): boolean

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:149

Helper function to check to see if a player has one or more collectibles.

This function is variadic, meaning that you can supply as many collectible types as you want to check for. Returns true if the player has any of the supplied collectible types.

This function always passes false to the ignoreModifiers argument.

EntityPlayer

…readonly CollectibleType[]

boolean


hasCollectibleInActiveSlot(player, collectibleType, …activeSlots): boolean

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:166

Helper function to check to see if a player has a specific collectible in one or more active slots.

This function is variadic, meaning that you can specify as many active slots as you want to check for. This function will return true if the collectible type is located in any of the active slots provided.

EntityPlayer

CollectibleType

…readonly ActiveSlot[]

boolean


hasOpenActiveItemSlot(player): boolean

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:186

Returns whether the player can hold an additional active item, beyond what they are currently carrying. This takes the Schoolbag into account.

If the player is the Tainted Soul, this always returns false, since that character cannot pick up items. (Only Tainted Forgotten can pick up items.)

EntityPlayer

boolean


isActiveSlotEmpty(player, activeSlot?): boolean

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:211

Helper function to check if the active slot of a particular player is empty.

EntityPlayer

The player to check.

ActiveSlot = ActiveSlot.PRIMARY

Optional. The active slot to check. Default is ActiveSlot.PRIMARY.

boolean


removeAllActiveItems(player): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:223

Helper function to remove all of the active items from a player. This includes the Schoolbag item and any pocket actives.

EntityPlayer

void


removeCollectible(player, …collectibleTypes): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:244

Helper function to remove one or more collectibles to a player.

This function is variadic, meaning that you can supply as many collectible types as you want to remove.

EntityPlayer

…readonly CollectibleType[]

void


removeCollectibleCostume(player, collectibleType): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:257

Helper function to remove a collectible costume from a player. Use this helper function to avoid having to request the collectible from the item config.

EntityPlayer

CollectibleType

void


removeCollectibleFromAllPlayers(…collectibleTypes): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:276

Helper function to remove one or more collectibles from all players. If any player has more than one copy of the item, then all copies of it will be removed.

This function is variadic, meaning that you can specify as many collectibles as you want to remove.

…readonly CollectibleType[]

void


setActiveItem(player, collectibleType, activeSlot?, charge?, keepInPools?): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:304

Helper function to set an active collectible to a particular slot. This has different behavior than calling the player.AddCollectible method with the activeSlot argument, because this function will not shift existing items into the Schoolbag and it handles ActiveSlot.SLOT_POCKET2.

Note that if an item is set to ActiveSlot.SLOT_POCKET2, it will disappear after being used and will be automatically removed upon entering a new room.

EntityPlayer

The player to give the item to.

CollectibleType

The collectible type of the item to give.

ActiveSlot = ActiveSlot.PRIMARY

Optional. The slot to set. Default is ActiveSlot.PRIMARY.

int

Optional. The argument of charges to set. If not specified, the item will be set with maximum charges.

boolean = false

Optional. Whether to remove the item from pools. Default is false.

void


useActiveItemTemp(player, collectibleType): void

Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:375

Helper function to use an active item without showing an animation, keeping the item, or adding any costumes.

EntityPlayer

CollectibleType

void