# Class "EntityNPC"

## Functions

### AnimWalkFrame () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### void AnimWalkFrame ( string HorizontalAnim, string VerticalAnim, float SpeedThreshold ) {: .copyable aria-label='Functions' }

### CalcTargetPosition () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) CalcTargetPosition ( float DistanceLimit ) {: .copyable aria-label='Functions' }

### CanBeDamagedFromVelocity () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### boolean CanBeDamagedFromVelocity ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) Velocity ) {: .copyable aria-label='Functions' }

### CanReroll () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### boolean CanReroll ( ) {: .copyable aria-label='Functions' }

### FireBossProjectiles () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [EntityProjectile](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/EntityProjectile/README.md) FireBossProjectiles ( int NumProjectiles, [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) TargetPos, float TrajectoryModifier, [ProjectileParams](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/ProjectileParams/README.md) Params ) {: .copyable aria-label='Functions' }

fire a number of projectiles, optionally targeting the player direction is randomized, or slightly randomized when targeting the player FallingAccelModifier can be used to make projectiles fall faster to the ground returns a pointer to the projectile spawned last (useful e.g. when NumProjectiles=1)

### FireProjectiles () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### void FireProjectiles ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) Pos, [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) Velocity, ProjectilesMode Mode, [ProjectileParams](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/ProjectileParams/README.md) Params ) {: .copyable aria-label='Functions' }

### GetAliveEnemyCount () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int GetAliveEnemyCount ( ) {: .copyable aria-label='Functions' }

Used to redirect close door enemies to any enemies for friendly npcs.

### GetBossColorIdx () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int GetBossColorIdx ( ) {: .copyable aria-label='Functions' }

???- note "Notes" This will return the boss color idx reduced by 1. To get the actual color as set in bosscolors.xml, add +1 to the result.

### GetChampionColorIdx () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int GetChampionColorIdx ( ) {: .copyable aria-label='Functions' }

???- note "Notes" A list of Champion colors can be found here : ChampionColorIdx

### GetPlayerTarget () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [Entity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Entity/README.md) GetPlayerTarget ( ) {: .copyable aria-label='Functions' }

if there are no modifiers (best friend) this will return the player

### IsBoss () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### boolean IsBoss ( ) {: .copyable aria-label='Functions' }

### IsChampion () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### boolean IsChampion ( ) {: .copyable aria-label='Functions' }

### KillUnique () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### void KillUnique ( ) {: .copyable aria-label='Functions' }

For entities with unique death animation, like Flush! vs poop enemies.

### MakeChampion () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### void MakeChampion ( int Seed ) {: .copyable aria-label='Functions' }

Forces a non champion to become a champion, resets hp to max hp.

???- note "Notes" Hard to use because there are millions of possible seeds to input here.Use Morph() to change the champion Color instead!

### MakeSplat () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [EntityEffect](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/EntityEffect/README.md) MakeSplat ( float Size ) {: .copyable aria-label='Functions' }

### Morph () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### boolean Morph ( [EntityType](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/EntityType/README.md) , int Variant, int SubType, int ChampionColorIdx ) {: .copyable aria-label='Functions' }

Morph the current entity into another one. [ChampionColorIdx](https://bindingofisaacrebirth.gamepedia.com/Monsters#Champions) can be used to turn the entity into a champion. Use `:::lua -1` to turn it into a regular entity. A list of Champion colors can be found here : [ChampionColorIdx](https://bindingofisaacrebirth.gamepedia.com/Monsters#Champions)

???- example "Example Code" This code turns an entity into a gaper.

```lua
    entity:ToNPC():Morph(EntityType.ENTITY_GAPER , 0, 0,-1)
```

### PlaySound () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### void PlaySound ( [SoundEffect](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/SoundEffect/README.md) ID, float Volume, int FrameDelay, boolean Loop, float Pitch ) {: .copyable aria-label='Functions' }

### QueryNPCsGroup () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [EntityList](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/CppContainer_EntityList/README.md) QueryNPCsGroup ( int GroupIdx ) {: .copyable aria-label='Functions' }

### QueryNPCsSpawnerType () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [EntityList](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/CppContainer_EntityList/README.md) QueryNPCsSpawnerType ( [EntityType](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/EntityType/README.md) SpawnerType, [EntityType](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/EntityType/README.md) Type, boolean OnlyEnemies ) {: .copyable aria-label='Functions' }

### QueryNPCsType () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [EntityList](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/CppContainer_EntityList/README.md) QueryNPCsType ( [EntityType](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/EntityType/README.md) Type, int Variant ) {: .copyable aria-label='Functions' }

### ResetPathFinderTarget () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### void ResetPathFinderTarget ( ) {: .copyable aria-label='Functions' }

### ThrowSpider () {: aria-label='Functions' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .static .tooltip .badge } [ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### static ThrowSpider ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) Position, [Entity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Entity/README.md) Spawner, [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) TargetPos, boolean Big, float YOffset ) {: .copyable aria-label='Functions' }

## Variables

### CanShutDoors {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### boolean CanShutDoors  {: .copyable aria-label='Variables' }

### ChildNPC {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [EntityNPC](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/EntityNPC/README.md) ChildNPC  {: .copyable aria-label='Variables' }

### [EntityRef](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/EntityRef/README.md) {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [Entity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Entity/README.md) [EntityRef](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/EntityRef/README.md)  {: .copyable aria-label='Variables' }

### GroupIdx {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int GroupIdx  {: .copyable aria-label='Variables' }

Used to identify multichunks groups.

### I1 {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int I1  {: .copyable aria-label='Variables' }

general usage ints for ai\_

### I2 {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int I2  {: .copyable aria-label='Variables' }

same as m\_I1

### ParentNPC {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [EntityNPC](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/EntityNPC/README.md) ParentNPC  {: .copyable aria-label='Variables' }

parent entity, for multi-entity NPCs like Larry Jr.

### Pathfinder {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [PathFinder](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/PathFinder/README.md) Pathfinder  {: .copyable aria-label='Variables' }

### ProjectileCooldown {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int ProjectileCooldown  {: .copyable aria-label='Variables' }

projectiles can fire again when it reaches 0

### ProjectileDelay {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int ProjectileDelay  {: .copyable aria-label='Variables' }

\>0: projectile will be fired in n frames

### Scale {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### float Scale  {: .copyable aria-label='Variables' }

### State {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int State  {: .copyable aria-label='Variables' }

### StateFrame {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### int StateFrame  {: .copyable aria-label='Variables' }

### V1 {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) V1  {: .copyable aria-label='Variables' }

general usage for ai\_\* functions, initialized to (0,0)

### V2 {: aria-label='Variables' }

[ ](https://docs.moddingofisaac.com/ab_p/beta/docs/entitynpc){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) V2  {: .copyable aria-label='Variables' }

like m\_V1, in case we need two of those
