Modded Element Sets
Classes
Section titled “Classes”ModdedElementSets
Section titled “ModdedElementSets”Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:87
A feature that lazy-inits and caches various arrays and sets that include both vanilla and modded elements. This is useful for performance purposes (so that we do not have to reconstruct the arrays/sets multiple times).
The modded arrays/sets are created using the functions from
ISCFeature.MODDED_ELEMENT_DETECTION.
Extends
Section titled “Extends”Feature
Methods
Section titled “Methods”getCollectibleTypes()
Section titled “getCollectibleTypes()”getCollectibleTypes(): readonly
CollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:494
Returns an array containing every valid collectible type in the game, including modded collectibles.
Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
then use the getCollectibleTypesSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly CollectibleType[]
getCollectibleTypeSet()
Section titled “getCollectibleTypeSet()”getCollectibleTypeSet():
ReadonlySet<CollectibleType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:515
Returns a set containing every valid collectible type in the game, including modded collectibles.
Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
then use the getCollectibleTypes helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<CollectibleType>
getModdedCollectibleTypes()
Section titled “getModdedCollectibleTypes()”getModdedCollectibleTypes(): readonly
CollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:535
Returns an array containing every modded collectible type in the game.
Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
then use the getModdedCollectibleTypesSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly CollectibleType[]
getModdedCollectibleTypesSet()
Section titled “getModdedCollectibleTypesSet()”getModdedCollectibleTypesSet():
ReadonlySet<CollectibleType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:555
Returns a set containing every modded collectible type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
then use the getModdedCollectibleTypes helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<CollectibleType>
getPlayerCollectibleMap()
Section titled “getPlayerCollectibleMap()”getPlayerCollectibleMap(
player):ReadonlyMap<CollectibleType,int>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:575
Iterates over every collectible in the game and returns a map containing the number of each item that the player has.
Note that this will filter out non-real collectibles like Lilith’s Incubus.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”ReadonlyMap<CollectibleType, int>
getTrinketTypes()
Section titled “getTrinketTypes()”getTrinketTypes(): readonly
TrinketType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:632
Returns an array containing every modded trinket type in the game.
Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
then use the getModdedTrinketTypesSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly TrinketType[]
getTrinketTypesSet()
Section titled “getTrinketTypesSet()”getTrinketTypesSet():
ReadonlySet<TrinketType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:652
Returns a set containing every modded trinket type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
then use the getModdedTrinketTypes helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<TrinketType>
getModdedTrinketTypes()
Section titled “getModdedTrinketTypes()”getModdedTrinketTypes(): readonly
TrinketType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:672
Returns an array containing every modded trinket type in the game.
Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
then use the getModdedTrinketTypesSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly TrinketType[]
getModdedTrinketTypesSet()
Section titled “getModdedTrinketTypesSet()”getModdedTrinketTypesSet():
ReadonlySet<TrinketType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:692
Returns a set containing every modded trinket type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
then use the getModdedTrinketTypes helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<TrinketType>
getCardTypes()
Section titled “getCardTypes()”getCardTypes(): readonly
CardType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:715
Returns an array containing every valid card type in the game, including modded cards.
Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
use the getCardTypesSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly CardType[]
getCardTypesSet()
Section titled “getCardTypesSet()”getCardTypesSet():
ReadonlySet<CardType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:734
Returns a set containing every valid card type in the game, including modded cards.
Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
use the getCardTypes helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<CardType>
getModdedCardTypes()
Section titled “getModdedCardTypes()”getModdedCardTypes(): readonly
CardType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:753
Returns an array containing every modded card type in the game.
Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
use the getModdedCardTypesSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly CardType[]
getModdedCardTypesSet()
Section titled “getModdedCardTypesSet()”getModdedCardTypesSet():
ReadonlySet<CardType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:772
Returns a set containing every modded card type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
use the getModdedCardTypes helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<CardType>
getPillEffects()
Section titled “getPillEffects()”getPillEffects(): readonly
PillEffect[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:796
Returns an array containing every valid pill effect in the game, including modded pill effects.
Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups,
then use the getPillEffectSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly PillEffect[]
getPillEffectsSet()
Section titled “getPillEffectsSet()”getPillEffectsSet():
ReadonlySet<PillEffect>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:816
Returns a set containing every valid pill effect in the game, including modded pill effects.
Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order,
then use the getPillEffects helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<PillEffect>
getModdedPillEffects()
Section titled “getModdedPillEffects()”getModdedPillEffects(): readonly
PillEffect[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:836
Returns an array containing every modded pill effect in the game.
Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups,
then use the getModdedPillEffectsSet helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly PillEffect[]
getModdedPillEffectsSet()
Section titled “getModdedPillEffectsSet()”getModdedPillEffectsSet():
ReadonlySet<PillEffect>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:856
Returns a set containing every modded pill effect in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order,
then use the getModdedPillEffects helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<PillEffect>
getCollectibleTypesWithCacheFlag()
Section titled “getCollectibleTypesWithCacheFlag()”getCollectibleTypesWithCacheFlag(
cacheFlag): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:878
Returns a set containing every collectible type with the given cache flag, including modded collectibles.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”cacheFlag
Section titled “cacheFlag”CacheFlagValue
Returns
Section titled “Returns”readonly CollectibleType[]
getTrinketsTypesWithCacheFlag()
Section titled “getTrinketsTypesWithCacheFlag()”getTrinketsTypesWithCacheFlag(
cacheFlag): readonlyTrinketType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:904
Returns a set containing every trinket type with the given cache flag, including modded trinkets.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”cacheFlag
Section titled “cacheFlag”CacheFlagValue
Returns
Section titled “Returns”readonly TrinketType[]
getPlayerCollectiblesWithCacheFlag()
Section titled “getPlayerCollectiblesWithCacheFlag()”getPlayerCollectiblesWithCacheFlag(
player,cacheFlag): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:944
Returns an array containing every collectible type that the player has that matches the
provided CacheFlag.
For example, if the cache flag is CacheFlag.FLYING, and the player has one Lord of the Pit
and two Dead Doves, then this function would return:
[ CollectibleType.LORD_OF_THE_PIT, CollectibleType.DEAD_DOVE, CollectibleType.DEAD_DOVE,]Note that this array will not include collectibles that the player does not really have, like Lilith’s Incubus.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
cacheFlag
Section titled “cacheFlag”CacheFlagValue
Returns
Section titled “Returns”readonly CollectibleType[]
getPlayerTrinketsWithCacheFlag()
Section titled “getPlayerTrinketsWithCacheFlag()”getPlayerTrinketsWithCacheFlag(
player,cacheFlag):ReadonlyMap<TrinketType,int>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:976
Returns a map containing every trinket type that the player has that matches the provided
CacheFlag. The values of the map correspond to the multiplier for that trinket.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
cacheFlag
Section titled “cacheFlag”CacheFlagValue
Returns
Section titled “Returns”ReadonlyMap<TrinketType, int>
getFlyingCollectibleTypes()
Section titled “getFlyingCollectibleTypes()”getFlyingCollectibleTypes(
includeConditionalItems): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1017
Returns a set of all of the collectibles that grant flight. This is derived from collectibles
that have CacheFlag.FLYING set in the “items.xml” file.
Vanilla collectibles that only grant flight conditionally are manually pruned. Collectibles
such as Empty Vessel should be checked for via the hasFlyingTemporaryEffect function.
Under the hood, this is determined by looking at the collectibles that have CacheFlag.FLYING
and excluding the ones that have CacheFlag.ALL. (None of the collectibles with
CacheFlag.ALL grant flying, including all of the 3 Dollar Bill collectibles and all of the
Birthright effects.)
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”includeConditionalItems
Section titled “includeConditionalItems”boolean
Whether collectibles that only grant flight conditionally should be included in the set (like Empty Vessel).
Returns
Section titled “Returns”readonly CollectibleType[]
getFlyingTrinketTypes()
Section titled “getFlyingTrinketTypes()”getFlyingTrinketTypes(): readonly
TrinketType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1044
Returns a set of all of the trinkets that grant flight. (All vanilla trinkets that grant flight do so conditionally, like Bat Wing and Azazel’s Stump.)
Under the hood, this is determined by looking at the trinkets that have CacheFlag.FLYING and
excluding the ones that have CacheFlag.ALL. (None of the trinket with CacheFlag.ALL grant
flying except for Azazel’s Stump.)
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”readonly TrinketType[]
getCollectibleTypesWithTag()
Section titled “getCollectibleTypesWithTag()”getCollectibleTypesWithTag(
itemConfigTag): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1072
Returns a set containing every collectible type with the given tag.
For example, to get all of the collectible types that count as offensive for the purposes of Tainted Lost:
const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”itemConfigTag
Section titled “itemConfigTag”ItemConfigTagValue
Returns
Section titled “Returns”readonly CollectibleType[]
getPlayerCollectiblesWithTag()
Section titled “getPlayerCollectiblesWithTag()”getPlayerCollectiblesWithTag(
player,itemConfigTag): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1098
Returns an array of collectible types that a player has with a particular tag.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
itemConfigTag
Section titled “itemConfigTag”ItemConfigTagValue
Returns
Section titled “Returns”readonly CollectibleType[]
getCollectibleTypesForTransformation()
Section titled “getCollectibleTypesForTransformation()”getCollectibleTypesForTransformation(
playerForm): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1136
Helper function to get all of the collectible types in the game that count towards a particular transformation.
For example, to get all of the collectible types that count towards Guppy:
const guppyCollectibleTypes = getCollectiblesForTransformation(PlayerForm.GUPPY);This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”playerForm
Section titled “playerForm”PlayerForm
Returns
Section titled “Returns”readonly CollectibleType[]
getPlayerCollectiblesForTransformation()
Section titled “getPlayerCollectiblesForTransformation()”getPlayerCollectiblesForTransformation(
player,playerForm): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1161
Returns an array of collectible types that a player has that count towards a particular transformation.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
playerForm
Section titled “playerForm”PlayerForm
Returns
Section titled “Returns”readonly CollectibleType[]
getEdenActiveCollectibleTypes()
Section titled “getEdenActiveCollectibleTypes()”getEdenActiveCollectibleTypes():
ReadonlySet<CollectibleType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1195
Returns a set containing every valid passive item that can be randomly granted to Eden as a starting item.
Under the hood, this is determined by looking at the “noeden” tag in “items_metadata.xml”.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<CollectibleType>
getEdenPassiveCollectibleTypes()
Section titled “getEdenPassiveCollectibleTypes()”getEdenPassiveCollectibleTypes():
ReadonlySet<CollectibleType>
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1215
Returns a set containing every valid passive item that can be randomly granted to Eden as a starting item.
Under the hood, this is determined by looking at the “noeden” tag in “items_metadata.xml”.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Returns
Section titled “Returns”ReadonlySet<CollectibleType>
getRandomEdenActiveCollectibleType()
Section titled “getRandomEdenActiveCollectibleType()”getRandomEdenActiveCollectibleType(
seedOrRNG,exceptions?):CollectibleType
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1239
Returns a random active collectible type that that is a valid starting item for Eden.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded collectible type, you must explicitly pass undefined to the
seedOrRNG parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”seedOrRNG
Section titled “seedOrRNG”RNG | Seed | undefined
The Seed or RNG object to use. If an RNG object is provided, the
RNG.Next method will be called. If undefined is provided, it will default
to a random seed.
exceptions?
Section titled “exceptions?”readonly CollectibleType[] = []
Optional. An array of runes to not select.
Returns
Section titled “Returns”CollectibleType
getRandomEdenPassiveCollectibleType()
Section titled “getRandomEdenPassiveCollectibleType()”getRandomEdenPassiveCollectibleType(
seedOrRNG,exceptions?):CollectibleType
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1272
Returns a random passive collectible type that that is a valid starting item for Eden (including familiars).
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded collectible type, you must explicitly pass undefined to the
seedOrRNG parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”seedOrRNG
Section titled “seedOrRNG”RNG | Seed | undefined
The Seed or RNG object to use. If an RNG object is provided, the
RNG.Next method will be called. If undefined is provided, it will default
to a random seed.
exceptions?
Section titled “exceptions?”readonly CollectibleType[] = []
Optional. An array of runes to not select.
Returns
Section titled “Returns”CollectibleType
getCollectibleTypesOfQuality()
Section titled “getCollectibleTypesOfQuality()”getCollectibleTypesOfQuality(
quality): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1301
Returns an array containing every collectible type with the given quality.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”quality
Section titled “quality”Quality
Returns
Section titled “Returns”readonly CollectibleType[]
getPlayerCollectiblesOfQuality()
Section titled “getPlayerCollectiblesOfQuality()”getPlayerCollectiblesOfQuality(
player,quality): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1327
Returns an array of collectible types that a player has that are of a particular quality.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
quality
Section titled “quality”Quality
Returns
Section titled “Returns”readonly CollectibleType[]
getCardTypesOfType()
Section titled “getCardTypesOfType()”getCardTypesOfType(…
itemConfigCardTypes): readonlyCardType[]
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1364
Helper function to get an array of card types matching the ItemConfigCardType.
This function is variadic, meaning that you can you can specify N card types to get an array containing cards that match any of the specified types.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”itemConfigCardTypes
Section titled “itemConfigCardTypes”…readonly ItemConfigCardType[]
Returns
Section titled “Returns”readonly CardType[]
getRandomCardTypeOfType()
Section titled “getRandomCardTypeOfType()”getRandomCardTypeOfType(
itemConfigCardType,seedOrRNG,exceptions?):CardType
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1406
Helper function to get a random card type that matches the provided ItemConfigCardType.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded card type, you must explicitly pass undefined to the
seedOrRNG parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”itemConfigCardType
Section titled “itemConfigCardType”ItemConfigCardType
The item config card type that represents the pool of cards to select from.
seedOrRNG
Section titled “seedOrRNG”RNG | Seed | undefined
The Seed or RNG object to use. If an RNG object is provided, the
RNG.Next method will be called. If undefined is provided, it will default
to a random seed.
exceptions?
Section titled “exceptions?”readonly CardType[] = []
Optional. An array of cards to not select.
Returns
Section titled “Returns”CardType
getRandomCard()
Section titled “getRandomCard()”getRandomCard(
seedOrRNG,exceptions?):CardType
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1437
Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.).
This will not return:
- any runes
- any objects like Dice Shard
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded card type, you must explicitly pass undefined to the
seedOrRNG parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”seedOrRNG
Section titled “seedOrRNG”RNG | Seed | undefined
The Seed or RNG object to use. If an RNG object is provided, the
RNG.Next method will be called. If undefined is provided, it will default
to a random seed.
exceptions?
Section titled “exceptions?”readonly CardType[] = []
Optional. An array of cards to not select.
Returns
Section titled “Returns”CardType
getRandomRune()
Section titled “getRandomRune()”getRandomRune(
seedOrRNG,exceptions?):CardType
Defined in: packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1464
Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul of Isaac, etc.). This will never return a Rune Shard.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded card type, you must explicitly pass undefined to the
seedOrRNG parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS.
Parameters
Section titled “Parameters”seedOrRNG
Section titled “seedOrRNG”RNG | Seed | undefined
The Seed or RNG object to use. If an RNG object is provided, the
RNG.Next method will be called. If undefined is provided, it will default
to a random seed.
exceptions?
Section titled “exceptions?”readonly CardType[] = []
Optional. An array of runes to not select.
Returns
Section titled “Returns”CardType
