Pocket Items
Functions
Section titled “Functions”getActivePocketItemSlot()
Section titled “getActivePocketItemSlot()”getActivePocketItemSlot(
player):PocketItemSlot|undefined
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:18
Helper function to get the PocketItemSlot that the player’s pocket active collectible item is
in, if any. Returns undefined if the player does not have a pocket active item.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”PocketItemSlot | undefined
getFirstCard()
Section titled “getFirstCard()”getFirstCard(
player):PocketItemDescription|undefined
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:32
Helper item to get the first card that a player is holding in their pocket item slots.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”PocketItemDescription | undefined
getFirstCardOrPill()
Section titled “getFirstCardOrPill()”getFirstCardOrPill(
player):PocketItemDescription|undefined
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:44
Helper item to get the first card or pill that a player is holding in their pocket item slots.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”PocketItemDescription | undefined
getFirstPill()
Section titled “getFirstPill()”getFirstPill(
player):PocketItemDescription|undefined
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:56
Helper item to get the first pill that a player is holding in their pocket item slots.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”PocketItemDescription | undefined
getPocketItems()
Section titled “getPocketItems()”getPocketItems(
player): readonlyPocketItemDescription[]
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:75
Use this helper function as a workaround for the EntityPlayer.GetPocketItem method not working
correctly.
Note that due to API limitations, there is no way to determine the location of a Dice Bag trinket
dice. Furthermore, when the player has a Dice Bag trinket dice and a pocket active at the same
time, there is no way to determine the location of the pocket active item. If this function
cannot determine the identity of a particular slot, it will mark the type of the slot as
PocketItemType.UNDETERMINABLE.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”readonly PocketItemDescription[]
hasOpenPocketItemSlot()
Section titled “hasOpenPocketItemSlot()”hasOpenPocketItemSlot(
player):boolean
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:149
Returns whether the player can hold an additional pocket item, beyond what they are currently carrying. This takes into account items that modify the max number of pocket items, like Starter Deck.
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
isFirstSlotPocketActiveItem()
Section titled “isFirstSlotPocketActiveItem()”isFirstSlotPocketActiveItem(
player):boolean
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:164
Helper function to determine whether the player’s “active” pocket item slot is set to their pocket active item.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”boolean
pocketItemsEquals()
Section titled “pocketItemsEquals()”pocketItemsEquals(
pocketItems1,pocketItems2):boolean
Defined in: packages/isaacscript-common/src/functions/pocketItems.ts:175
Helper function to see if two sets of pocket item descriptions are identical.
Parameters
Section titled “Parameters”pocketItems1
Section titled “pocketItems1”readonly PocketItemDescription[]
pocketItems2
Section titled “pocketItems2”readonly PocketItemDescription[]
Returns
Section titled “Returns”boolean
