NPCs
Functions
Section titled “Functions”getAliveNPCs()
Section titled “getAliveNPCs()”getAliveNPCs(
entityType?,variant?,subType?,ignoreFriendly?): readonlyEntityNPC[]
Defined in: packages/isaacscript-common/src/functions/npcs.ts:64
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
Section titled “Parameters”entityType?
Section titled “entityType?”-1 | EntityType
Optional. If specified, will only get the NPCs that match the type. Default is -1, which matches every type.
variant?
Section titled “variant?”number = -1
Optional. If specified, will only get the NPCs that match the variant. Default is -1, which matches every variant.
subType?
Section titled “subType?”number = -1
Optional. If specified, will only get the NPCs that match the sub-type. Default is -1, which matches every sub-type.
ignoreFriendly?
Section titled “ignoreFriendly?”boolean = false
Optional. Default is false.
Returns
Section titled “Returns”readonly EntityNPC[]
isAliveExceptionNPC()
Section titled “isAliveExceptionNPC()”isAliveExceptionNPC(
npc):boolean
Defined in: packages/isaacscript-common/src/functions/npcs.ts:78
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
Section titled “Parameters”EntityNPC
Returns
Section titled “Returns”boolean
isDaddyLongLegsChildStompEntity()
Section titled “isDaddyLongLegsChildStompEntity()”isDaddyLongLegsChildStompEntity(
npc):boolean
Defined in: packages/isaacscript-common/src/functions/npcs.ts:121
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
Section titled “Parameters”EntityNPC
Returns
Section titled “Returns”boolean
isDyingDump()
Section titled “isDyingDump()”isDyingDump(
npc):boolean
Defined in: packages/isaacscript-common/src/functions/npcs.ts:132
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
Section titled “Parameters”EntityNPC
Returns
Section titled “Returns”boolean
isDyingEggyWithNoSpidersLeft()
Section titled “isDyingEggyWithNoSpidersLeft()”isDyingEggyWithNoSpidersLeft(
npc):boolean
Defined in: packages/isaacscript-common/src/functions/npcs.ts:146
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
Section titled “Parameters”EntityNPC
Returns
Section titled “Returns”boolean
isRaglingDeathPatch()
Section titled “isRaglingDeathPatch()”isRaglingDeathPatch(
npc):boolean
Defined in: packages/isaacscript-common/src/functions/npcs.ts:162
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
Section titled “Parameters”EntityNPC
Returns
Section titled “Returns”boolean
