Skip to content

Modded Element Sets

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.

  • Feature

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.

readonly CollectibleType[]

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.

ReadonlySet<CollectibleType>

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.

readonly CollectibleType[]

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.

ReadonlySet<CollectibleType>

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.

EntityPlayer

ReadonlyMap<CollectibleType, int>

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.

readonly TrinketType[]

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.

ReadonlySet<TrinketType>

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.

readonly TrinketType[]

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.

ReadonlySet<TrinketType>

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.

readonly CardType[]

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.

ReadonlySet<CardType>

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.

readonly CardType[]

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.

ReadonlySet<CardType>

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.

readonly PillEffect[]

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.

ReadonlySet<PillEffect>

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.

readonly PillEffect[]

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.

ReadonlySet<PillEffect>

getCollectibleTypesWithCacheFlag(cacheFlag): readonly CollectibleType[]

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.

CacheFlagValue

readonly CollectibleType[]

getTrinketsTypesWithCacheFlag(cacheFlag): readonly TrinketType[]

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.

CacheFlagValue

readonly TrinketType[]

getPlayerCollectiblesWithCacheFlag(player, cacheFlag): readonly CollectibleType[]

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.

EntityPlayer

CacheFlagValue

readonly CollectibleType[]

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.

EntityPlayer

CacheFlagValue

ReadonlyMap<TrinketType, int>

getFlyingCollectibleTypes(includeConditionalItems): readonly CollectibleType[]

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.

boolean

Whether collectibles that only grant flight conditionally should be included in the set (like Empty Vessel).

readonly CollectibleType[]

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.

readonly TrinketType[]

getCollectibleTypesWithTag(itemConfigTag): readonly CollectibleType[]

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.

ItemConfigTagValue

readonly CollectibleType[]

getPlayerCollectiblesWithTag(player, itemConfigTag): readonly CollectibleType[]

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.

EntityPlayer

ItemConfigTagValue

readonly CollectibleType[]

getCollectibleTypesForTransformation(playerForm): readonly CollectibleType[]

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.

PlayerForm

readonly CollectibleType[]

getPlayerCollectiblesForTransformation(player, playerForm): readonly CollectibleType[]

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.

EntityPlayer

PlayerForm

readonly CollectibleType[]

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.

ReadonlySet<CollectibleType>

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.

ReadonlySet<CollectibleType>

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.

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.

readonly CollectibleType[] = []

Optional. An array of runes to not select.

CollectibleType

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.

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.

readonly CollectibleType[] = []

Optional. An array of runes to not select.

CollectibleType

getCollectibleTypesOfQuality(quality): readonly CollectibleType[]

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.

Quality

readonly CollectibleType[]

getPlayerCollectiblesOfQuality(player, quality): readonly CollectibleType[]

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.

EntityPlayer

Quality

readonly CollectibleType[]

getCardTypesOfType(…itemConfigCardTypes): readonly CardType[]

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.

…readonly ItemConfigCardType[]

readonly CardType[]

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.

ItemConfigCardType

The item config card type that represents the pool of cards to select from.

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.

readonly CardType[] = []

Optional. An array of cards to not select.

CardType

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.

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.

readonly CardType[] = []

Optional. An array of cards to not select.

CardType

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.

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.

readonly CardType[] = []

Optional. An array of runes to not select.

CardType