Skip to content

Class "PocketItem"⚓︎

Info

You can get this class by using the following functions:

Example Code
1
local pocket = Isaac.GetPlayer(0):GetPocketItem(0)

Functions⚓︎

GetSlot ()⚓︎

int GetSlot ( )⚓︎

Returns an identifying value for this pocket item. Varies depending on the PocketItemType.

Returns 0 if the pocket slot is empty.

For cards, returns Card.

For pills, returns PillColor.

For pocket active items, returns the corresponding ActiveSlot+1 (so ActiveSlot.SLOT_POCKET + 1 or ActiveSlot.SLOT_POCKET2 + 1).

Example code to obtain the CollectibleType of the pocket active item in a given pocket slot:
1
2
3
4
5
local pocketItem = player:GetPocketItem(PillCardSlot.PRIMARY)
if pocketItem:GetType() == PocketItemType.ACTIVE_ITEM then
  local activeSlot = pocketItem:GetSlot() - 1
  local activeItemID = player:GetActiveItem(activeSlot)
end

GetType ()⚓︎

PocketItemType GetType ( )⚓︎

Returns the PocketItemType.

This value is unreliable if the slot is currently empty, as the game sometimes does not clear it.