Skip to main content

NPCs

Functions

getAliveNPCs

getAliveNPCs(entityType?, variant?, subType?, ignoreFriendly?): readonly EntityNPC[]

Helper function to get all of the non-dead NPCs in the room.

This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn holes.

Parameters

NameTypeDefault valueDescription
entityType-1 | EntityType-1Optional. If specified, will only get the NPCs that match the type. Default is -1, which matches every type.
variantnumber-1Optional. If specified, will only get the NPCs that match the variant. Default is -1, which matches every variant.
subTypenumber-1Optional. If specified, will only get the NPCs that match the sub-type. Default is -1, which matches every sub-type.
ignoreFriendlybooleanfalseOptional. Default is false.

Returns

readonly EntityNPC[]

Defined in

packages/isaacscript-common/src/functions/npcs.ts:64


isAliveExceptionNPC

isAliveExceptionNPC(npc): boolean

Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should not actually keep the doors closed (like Death's scythes).

Parameters

NameType
npcEntityNPC

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/npcs.ts:78


isDaddyLongLegsChildStompEntity

isDaddyLongLegsChildStompEntity(npc): boolean

Helper function to distinguish between a normal Daddy Long Legs / Triachnid and the child entity that is spawned when the boss does the multi-stomp attack.

When this attack occurs, four extra copies of Daddy Long Legs will be spawned with the same entity type, variant, and sub-type. The Entity.Parent field will be undefined in this case, so the way to tell them apart is to check for a non-undefined Entity.SpawnerEntity field.

Parameters

NameType
npcEntityNPC

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/npcs.ts:121


isDyingDump

isDyingDump(npc): boolean

Helper function to detect the custom death state of a Dump. When Dumps die, they go to NPCState.SPECIAL, spit out their head, and then slowly fade away while shooting a burst of tears.

Parameters

NameType
npcEntityNPC

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/npcs.ts:132


isDyingEggyWithNoSpidersLeft

isDyingEggyWithNoSpidersLeft(npc): boolean

Helper function to detect the custom death state of an Eggy. Eggies are never actually marked dead by the game. Instead, when Eggies take fatal damage, they go into NPCState.STATE_SUICIDE and spawn 14 Swarm Spiders while their StateFrame ticks upwards.

Parameters

NameType
npcEntityNPC

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/npcs.ts:145


isRaglingDeathPatch

isRaglingDeathPatch(npc): boolean

Helper function to detect the custom death state of a Rag Man Ragling. When Rag Man Raglings die, they turn into a patch on the ground and can be revived by Rag Man at a later time. This causes them to show up as an "alive" enemy, so they should usually be filtered out of lists of alive enemies.

Parameters

NameType
npcEntityNPC

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/npcs.ts:160