Player Collectibles
Functions
Section titled “Functions”addCollectible()
Section titled “addCollectible()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleTypes
Section titled “collectibleTypes”…readonly CollectibleType[]
Returns
Section titled “Returns”void
addCollectibleCostume()
Section titled “addCollectibleCostume()”addCollectibleCostume(
player,collectibleType):void
Defined in: packages/isaacscript-common/src/functions/playerCollectibles.ts:29
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”void
anyPlayerHasCollectible()
Section titled “anyPlayerHasCollectible()”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.
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType
The collectible type to check for.
ignoreModifiers?
Section titled “ignoreModifiers?”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.
Returns
Section titled “Returns”boolean
getActiveItemSlots()
Section titled “getActiveItemSlots()”getActiveItemSlots(
player,collectibleType): readonlyActiveSlot[]
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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”readonly ActiveSlot[]
getAdjustedPrice()
Section titled “getAdjustedPrice()”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.)
Parameters
Section titled “Parameters”basePrice
Section titled “basePrice”int
Returns
Section titled “Returns”int
getPlayerCollectibleCount()
Section titled “getPlayerCollectibleCount()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleTypes
Section titled “collectibleTypes”…readonly CollectibleType[]
Returns
Section titled “Returns”int
getPlayersWithCollectible()
Section titled “getPlayersWithCollectible()”getPlayersWithCollectible(…
collectibleTypes): readonlyEntityPlayer[]
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.
Parameters
Section titled “Parameters”collectibleTypes
Section titled “collectibleTypes”…readonly CollectibleType[]
Returns
Section titled “Returns”readonly EntityPlayer[]
getTotalPlayerCollectibles()
Section titled “getTotalPlayerCollectibles()”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.
Parameters
Section titled “Parameters”collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”int
hasCollectible()
Section titled “hasCollectible()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleTypes
Section titled “collectibleTypes”…readonly CollectibleType[]
Returns
Section titled “Returns”boolean
hasCollectibleInActiveSlot()
Section titled “hasCollectibleInActiveSlot()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleType
Section titled “collectibleType”CollectibleType
activeSlots
Section titled “activeSlots”…readonly ActiveSlot[]
Returns
Section titled “Returns”boolean
hasOpenActiveItemSlot()
Section titled “hasOpenActiveItemSlot()”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.)
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”boolean
isActiveSlotEmpty()
Section titled “isActiveSlotEmpty()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
The player to check.
activeSlot?
Section titled “activeSlot?”ActiveSlot = ActiveSlot.PRIMARY
Optional. The active slot to check. Default is ActiveSlot.PRIMARY.
Returns
Section titled “Returns”boolean
removeAllActiveItems()
Section titled “removeAllActiveItems()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”void
removeCollectible()
Section titled “removeCollectible()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleTypes
Section titled “collectibleTypes”…readonly CollectibleType[]
Returns
Section titled “Returns”void
removeCollectibleCostume()
Section titled “removeCollectibleCostume()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”void
removeCollectibleFromAllPlayers()
Section titled “removeCollectibleFromAllPlayers()”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.
Parameters
Section titled “Parameters”collectibleTypes
Section titled “collectibleTypes”…readonly CollectibleType[]
Returns
Section titled “Returns”void
setActiveItem()
Section titled “setActiveItem()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
The player to give the item to.
collectibleType
Section titled “collectibleType”CollectibleType
The collectible type of the item to give.
activeSlot?
Section titled “activeSlot?”ActiveSlot = ActiveSlot.PRIMARY
Optional. The slot to set. Default is ActiveSlot.PRIMARY.
charge?
Section titled “charge?”int
Optional. The argument of charges to set. If not specified, the item will be set with maximum charges.
keepInPools?
Section titled “keepInPools?”boolean = false
Optional. Whether to remove the item from pools. Default is false.
Returns
Section titled “Returns”void
useActiveItemTemp()
Section titled “useActiveItemTemp()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
collectibleType
Section titled “collectibleType”CollectibleType
Returns
Section titled “Returns”void
