Pickups
Functions
Section titled “Functions”getBatteryName()
Section titled “getBatteryName()”getBatteryName(
batterySubType):string
Defined in: packages/isaacscript-common/src/functions/pickups.ts:35
Helper function to get the name of a battery, as listed in the “entities2.xml” file. Returns “Unknown” if the provided battery sub-type is not valid.
This function only works for vanilla battery types.
For example, getBatteryName(BatterySubType.MICRO) would return “Micro Battery”.
Parameters
Section titled “Parameters”batterySubType
Section titled “batterySubType”BatterySubType
Returns
Section titled “Returns”string
getBombName()
Section titled “getBombName()”getBombName(
bombSubType):string
Defined in: packages/isaacscript-common/src/functions/pickups.ts:49
Helper function to get the name of a bomb, as listed in the “entities2.xml” file. Returns “Unknown” if the provided bomb sub-type is not valid.
This function only works for vanilla bomb types.
For example, getBombName(BombSubType.DOUBLE_PACK) would return “Double Bomb”.
Parameters
Section titled “Parameters”bombSubType
Section titled “bombSubType”BombSubType
Returns
Section titled “Returns”string
getChestName()
Section titled “getChestName()”getChestName(
pickupVariant):string
Defined in: packages/isaacscript-common/src/functions/pickups.ts:63
Helper function to get the name of a chest, as listed in the “entities2.xml” file. Returns “Unknown” if the pickup variant was not a chest.
This function only works for vanilla chest types.
For example, getChestName(PickupVariant.SPIKED_CHEST) would return “Spiked Chest”.
Parameters
Section titled “Parameters”pickupVariant
Section titled “pickupVariant”PickupVariant
Returns
Section titled “Returns”string
getCoinName()
Section titled “getCoinName()”getCoinName(
coinSubType):string
Defined in: packages/isaacscript-common/src/functions/pickups.ts:76
Helper function to get the name of a coin, as listed in the “entities2.xml” file. Returns “Unknown” if the provided coin sub-type is not valid.
This function only works for vanilla chest types.
For example, getCoinName(CoinSubType.DOUBLE_PACK) would return “Double Penny”.
Parameters
Section titled “Parameters”coinSubType
Section titled “coinSubType”CoinSubType
Returns
Section titled “Returns”string
getCoinValue()
Section titled “getCoinValue()”getCoinValue(
coinSubType):int
Defined in: packages/isaacscript-common/src/functions/pickups.ts:86
Helper function to get the corresponding coin amount from a CoinSubType. Returns 1 for modded
sub-types.
Parameters
Section titled “Parameters”coinSubType
Section titled “coinSubType”CoinSubType
Returns
Section titled “Returns”int
getHeartName()
Section titled “getHeartName()”getHeartName(
heartSubType):string
Defined in: packages/isaacscript-common/src/functions/pickups.ts:101
Helper function to get the name of a heart, as listed in the “entities2.xml” file. Returns “Unknown” if the provided heart sub-type is not valid.
This function only works for vanilla heart types.
For example, getHeartName(HeartSubType.ETERNAL) would return “Heart (eternal)”.
Parameters
Section titled “Parameters”heartSubType
Section titled “heartSubType”HeartSubType
Returns
Section titled “Returns”string
getKeyName()
Section titled “getKeyName()”getKeyName(
keySubType):string
Defined in: packages/isaacscript-common/src/functions/pickups.ts:115
Helper function to get the name of a key, as listed in the “entities2.xml” file. Returns “Unknown” if the provided key sub-type is not valid.
This function only works for vanilla key types.
For example, getKeyName(KeySubType.DOUBLE_PACK) would return “Key Ring”.
Parameters
Section titled “Parameters”keySubType
Section titled “keySubType”KeySubType
Returns
Section titled “Returns”string
getRedHearts()
Section titled “getRedHearts()”getRedHearts(): readonly
EntityPickupHeart[]
Defined in: packages/isaacscript-common/src/functions/pickups.ts:122
Helper function to get all of the red heart pickup entities in the room.
Returns
Section titled “Returns”readonly EntityPickupHeart[]
getSackName()
Section titled “getSackName()”getSackName(
sackSubType):string
Defined in: packages/isaacscript-common/src/functions/pickups.ts:135
Helper function to get the name of a sack, as listed in the “entities2.xml” file. Returns “Unknown” if the provided sack sub-type is not valid.
This function only works for vanilla sack types.
For example, getSackName(SackSubType.NORMAL) would return “Grab Bag”.
Parameters
Section titled “Parameters”sackSubType
Section titled “sackSubType”SackSubType
Returns
Section titled “Returns”string
isChest()
Section titled “isChest()”isChest(
pickup):boolean
Defined in: packages/isaacscript-common/src/functions/pickups.ts:142
Helper function to test if the provided pickup matches one of the various chest variants.
Parameters
Section titled “Parameters”pickup
Section titled “pickup”EntityPickup
Returns
Section titled “Returns”boolean
isChestVariant()
Section titled “isChestVariant()”isChestVariant(
pickupVariant):boolean
Defined in: packages/isaacscript-common/src/functions/pickups.ts:149
Helper function to test if the provided pickup variant matches one of the various chest variants.
Parameters
Section titled “Parameters”pickupVariant
Section titled “pickupVariant”PickupVariant
Returns
Section titled “Returns”boolean
isRedHeart()
Section titled “isRedHeart()”isRedHeart(
pickup):boolean
Defined in: packages/isaacscript-common/src/functions/pickups.ts:156
Helper function to test if the provided pickup matches one of the various red heart sub-types.
Parameters
Section titled “Parameters”pickup
Section titled “pickup”EntityPickup
Returns
Section titled “Returns”boolean
isRedHeartSubType()
Section titled “isRedHeartSubType()”isRedHeartSubType(
heartSubType):boolean
Defined in: packages/isaacscript-common/src/functions/pickups.ts:164
Helper function to test if the provided heart sub-type matches one of the various red heart sub-types.
Parameters
Section titled “Parameters”heartSubType
Section titled “heartSubType”HeartSubType
Returns
Section titled “Returns”boolean
removeAllRedHearts()
Section titled “removeAllRedHearts()”removeAllRedHearts(
cap?): readonlyEntityPickupHeart[]
Defined in: packages/isaacscript-common/src/functions/pickups.ts:174
Helper function to remove all of the red heart pickup entities in the room.
Parameters
Section titled “Parameters”int
Optional. If specified, will only remove the given amount of hearts.
Returns
Section titled “Returns”readonly EntityPickupHeart[]
The red hearts that were removed.
