Skip to main content

Pocket Items

Functions

getActivePocketItemSlot

getActivePocketItemSlot(player): PocketItemSlot | undefined

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

NameType
playerEntityPlayer

Returns

PocketItemSlot | undefined

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:18


getFirstCard

getFirstCard(player): PocketItemDescription | undefined

Helper item to get the first card that a player is holding in their pocket item slots.

Parameters

NameType
playerEntityPlayer

Returns

PocketItemDescription | undefined

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:32


getFirstCardOrPill

getFirstCardOrPill(player): PocketItemDescription | undefined

Helper item to get the first card or pill that a player is holding in their pocket item slots.

Parameters

NameType
playerEntityPlayer

Returns

PocketItemDescription | undefined

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:44


getFirstPill

getFirstPill(player): PocketItemDescription | undefined

Helper item to get the first pill that a player is holding in their pocket item slots.

Parameters

NameType
playerEntityPlayer

Returns

PocketItemDescription | undefined

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:56


getPocketItems

getPocketItems(player): readonly PocketItemDescription[]

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

NameType
playerEntityPlayer

Returns

readonly PocketItemDescription[]

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:75


hasOpenPocketItemSlot

hasOpenPocketItemSlot(player): boolean

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

NameType
playerEntityPlayer

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:149


isFirstSlotPocketActiveItem

isFirstSlotPocketActiveItem(player): boolean

Helper function to determine whether the player's "active" pocket item slot is set to their pocket active item.

Parameters

NameType
playerEntityPlayer

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:164


pocketItemsEquals

pocketItemsEquals(pocketItems1, pocketItems2): boolean

Helper function to see if two sets of pocket item descriptions are identical.

Parameters

NameType
pocketItems1readonly PocketItemDescription[]
pocketItems2readonly PocketItemDescription[]

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/pocketItems.ts:175