Class "Entity"

Functions

AddBurn () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddBurn ( EntityRefarrow-up-right Source, int Duration, float Damage ) {: .copyable aria-label='Functions' }

Adds a burn-effect to an enemy. Duration is in Number of Frames. Damage is the Damage taken per frame.

???- example "Example Code" This code damages every entity in the room for 1 second with the damagesource set to the player. The total damage dealt is 30.

    local player =Isaac.GetPlayer(0)
    for i, entity in ipairs(Isaac.GetRoomEntities()) do
        entity:AddBurn(player,30,1)
    end

AddCharmed () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddCharmed ( int Duration ) {: .copyable aria-label='Functions' }

Adds a charmed-effect to an enemy. Duration is in Number of Frames. Charmed enemies are friendly towards isaac and attack other enemies.

:::lua AddCharmed(-1) makes the effect permanent and the enemy will follow you even to different rooms.

???- example "Example Code" This code charms every entity in the room for 1 second.

AddConfusion () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddConfusion ( EntityRefarrow-up-right Source, int Duration, boolean IgnoreBosses ) {: .copyable aria-label='Functions' }

Adds a confusion effect to an entity.

???- example "Example Code" This code confuses every entity in the room for 1 second while ignoring bosses.

AddEntityFlags () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddEntityFlags ( int Flags ) {: .copyable aria-label='Functions' }

Add EntityFlagsarrow-up-right to the entity. Flags are used to add specific effects like poisoning or freeze. You can add multiple flags at the same time by bitwise-concatenating them.

???- example "Example Code" This code adds slowing and confusion to the enetity.

AddFear () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddFear ( EntityRefarrow-up-right Source, int Duration ) {: .copyable aria-label='Functions' }

Adds a fear-effect to an entity.

???- example "Example Code" This code frightens every entity in the room for 1 second.

AddFreeze () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddFreeze ( EntityRefarrow-up-right Source, int Duration ) {: .copyable aria-label='Functions' }

Freezes an entity, making it unable to move and attack.

???- example "Example Code" This code freezes every entity in the room for half a second.

AddHealth () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddHealth ( float HitPoints ) {: .copyable aria-label='Functions' }

Heals an entity.

AddMidasFreeze () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddMidasFreeze ( EntityRefarrow-up-right Source, int Duration ) {: .copyable aria-label='Functions' }

Turns the entity into a gold statue (can't move, can't attack, drops coins when killed)

AddPoison () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddPoison ( EntityRefarrow-up-right Source, int Duration, float Damage ) {: .copyable aria-label='Functions' }

Adds a poison effect to the entity.

AddShrink () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddShrink ( EntityRefarrow-up-right Source, int Duration ) {: .copyable aria-label='Functions' }

Adds a shrink effect to the entity.

AddSlowing () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddSlowing ( EntityRefarrow-up-right Source, int Duration, float SlowValue, Colorarrow-up-right SlowColor ) {: .copyable aria-label='Functions' }

Makes the friction higher.

AddVelocity () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AddVelocity ( Vectorarrow-up-right Velocity ) {: .copyable aria-label='Functions' }

Adds velocity to the entity. This can be used to move him in a certain direktion (for example as a result of collision)

BloodExplode () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Explodes with gibs and blood.

CanShutDoors () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

enemies keep the doors shut.

ClearEntityFlags () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void ClearEntityFlags ( int Flags ) {: .copyable aria-label='Functions' }

Removes all EntityFlagsarrow-up-right from the entity.

CollidesWithGrid () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Returns true, if the entity is able to collide with the grid.

Die () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Kills the entity and trigger its death animation.

Exists () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Returns true, if this entity still exists.

GetBossID () {: aria-label='Functions' }

{: .abp .tooltip .badge }

BossId GetBossID ( ) {: .copyable aria-label='Functions' }

If the entity is a boss, it returns its specific boss id. If it isnt a boss it will return 0.

GetColor () {: aria-label='Functions' }

{: .abp .tooltip .badge }

Colorarrow-up-right GetColor ( ) {: .copyable aria-label='Functions' }

Returns the Color object assosiated to this entity.

GetData () {: aria-label='Functions' }

{: .abp .tooltip .badge }

table GetData ( ) {: .copyable aria-label='Functions' }

Returns a table that contains all data assosiated with the entity. This can be used to add custom data as well.

???- note "Notes" Data associated with an entity does only persists in between rooms, when the entity is a player, familiar or the entity has the "EntityFlag.FLAG_PERSISTENT" Flag active. Data does not persists in between exiting the game to a menu, or when restarting/finishing a run.

???- example "Example Code" This code adds custom data to an entity or prints it in the console if it exists.

GetDropRNG () {: aria-label='Functions' }

{: .abp .tooltip .badge }

RNGarrow-up-right GetDropRNG ( ) {: .copyable aria-label='Functions' }

Returns the assigned RNG object for the entity. This RNG is used to determine the items that are dropped on the entities death.

GetEntityFlags () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Get the EntityFlagsarrow-up-rightof the entity. This will be a number which acts like a bitmask.

???- example "Example Code" This code prints something in the console, if the entity has a specific EntityFlagsarrow-up-right.

GetLastChild () {: aria-label='Functions' }

{: .abp .tooltip .badge }

Entityarrow-up-right GetLastChild ( ) {: .copyable aria-label='Functions' }

Returns the last entity spawned by this entity.

GetLastParent () {: aria-label='Functions' }

{: .abp .tooltip .badge }

Entityarrow-up-right GetLastParent ( ) {: .copyable aria-label='Functions' }

Returns the last parent of this entity.

GetSprite () {: aria-label='Functions' }

{: .abp .tooltip .badge }

Spritearrow-up-right GetSprite ( ) {: .copyable aria-label='Functions' }

Return the sprite object of the entity.

HasCommonParentWithEntity () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean HasCommonParentWithEntity ( Entityarrow-up-right Other ) {: .copyable aria-label='Functions' }

HasEntityFlags () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean HasEntityFlags ( int Flags ) {: .copyable aria-label='Functions' }

Returns true, if the entity has all named EntityFlagsarrow-up-right set.

???- example "Example Code" This code prints something in the console, if the entity has a specific EntityFlagsarrow-up-right.

HasFullHealth () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

HasMortalDamage () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

???- note "Notes" The game adds taken damage to a damage buffer, which gets applied in the next frame. HasMortalDamage() returns true if the buffered damage is enough to kill the entity. HasMortalDamage() will be updated additionally after TakeDamage() is called.

IsActiveEnemy () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean IsActiveEnemy ( boolean includeDead ) {: .copyable aria-label='Functions' }

return true for non background NPCs (ex: every enemy except fire and shopkeepers)

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

{: .abp .tooltip .badge }

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

bosses display health bar

IsDead () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

IsEnemy () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

return true for NPCs that are not controlled by the player

IsFlying () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

IsFrame () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean IsFrame ( int Frame, int Offset ) {: .copyable aria-label='Functions' }

true every X frames

IsInvincible () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

IsVisible () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

IsVulnerableEnemy () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

return true for enemies that can be damaged

Kill () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Kills the entity and makes a blood splat or gibs.

MultiplyFriction () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void MultiplyFriction ( float Value ) {: .copyable aria-label='Functions' }

PostRender () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Remove () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Remove the entity from the game instantly, without doing any additional effects/animations.

RemoveStatusEffects () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Removes all Status Effects from the entity.

Render () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void Render ( Vectorarrow-up-right Offset ) {: .copyable aria-label='Functions' }

Render the current sprite of the Entity at the current entity position + offset.

RenderShadowLayer () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean RenderShadowLayer ( Vectorarrow-up-right Offset ) {: .copyable aria-label='Functions' }

Render the shadow / shadow layer again.

SetColor () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void SetColor ( Colorarrow-up-right Color, int Duration, int Priority, boolean Fadeout, boolean Share ) {: .copyable aria-label='Functions' }

Set the colormask for the entity. This can be used to tint the sprites in different colors.

???- example "Example Code" This code changes the color of the sprite to a fully white sprite for 15 frames.

SetSize () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void SetSize ( float Size, Vectorarrow-up-right SizeMulti, int NumGridCollisionPoints ) {: .copyable aria-label='Functions' }

Set the size ofthe entity.

SetSpriteFrame () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void SetSpriteFrame ( string AnimationName, int FrameNum ) {: .copyable aria-label='Functions' }

SetSpriteOverlayFrame () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void SetSpriteOverlayFrame ( string AnimationName, int FrameNum ) {: .copyable aria-label='Functions' }

TakeDamage () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean TakeDamage ( float Damage, int Flags, EntityRefarrow-up-right Source, int DamageCountdown ) {: .copyable aria-label='Functions' }

???- note "Notes" The game adds taken damage to a damage buffer, which gets applied in the next frame. Therefore, TakeDamage() will not decremented the entities HP immediately upon calling the function. Rather, it is only updated on the frame afterwards.

ToBomb () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityBombarrow-up-right ToBomb ( ) {: .copyable aria-label='Functions' }

ToEffect () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityEffectarrow-up-right ToEffect ( ) {: .copyable aria-label='Functions' }

ToFamiliar () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityFamiliararrow-up-right ToFamiliar ( ) {: .copyable aria-label='Functions' }

ToKnife () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityKnifearrow-up-right ToKnife ( ) {: .copyable aria-label='Functions' }

ToLaser () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityLaserarrow-up-right ToLaser ( ) {: .copyable aria-label='Functions' }

ToNPC () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityNPCarrow-up-right ToNPC ( ) {: .copyable aria-label='Functions' }

ToPickup () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityPickuparrow-up-right ToPickup ( ) {: .copyable aria-label='Functions' }

ToPlayer () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityPlayerarrow-up-right ToPlayer ( ) {: .copyable aria-label='Functions' }

ToProjectile () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityProjectilearrow-up-right ToProjectile ( ) {: .copyable aria-label='Functions' }

ToTear () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityTeararrow-up-right ToTear ( ) {: .copyable aria-label='Functions' }

Update () {: aria-label='Functions' }

{: .abp .tooltip .badge }

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

Child () {: aria-label='Functions' }

{: .abp .tooltip .badge }

Entityarrow-up-right Child {: .copyable aria-label='Functions' }

Variables

CollisionDamage {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

DepthOffset {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Get/Set the depth-offset of the entity. This value is added to the Y Position of the entity, which is then used to determine the rendering order of each entity. Default value is 0 for all entities.

???- example "Example Code" This code explains how this variable works.

DropSeed {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Get/set the Seed of the Drop RNG.

EntityCollisionClassarrow-up-right {: aria-label='Variables' }

{: .abp .tooltip .badge }

FlipX {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

FrameCount {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Friction {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

loaded from entity config

GridCollisionClassarrow-up-right {: aria-label='Variables' }

{: .abp .tooltip .badge }

HitPoints {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

???- note "Notes" The HitPoints value is not decremented immediately upon taking damage like you would expect. Rather, it is only updated on the frame after the entity takes damage.

Index {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

InitSeed {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Mass {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

MaxHitPoints {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Parent {: aria-label='Variables' }

{: .abp .tooltip .badge }

Entityarrow-up-right Parent {: .copyable aria-label='Variables' }

Position {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vectorarrow-up-right Position {: .copyable aria-label='Variables' }

PositionOffset {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vectorarrow-up-right PositionOffset {: .copyable aria-label='Variables' }

RenderZOffset {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

???+ bug "Bugs" This variable doesnt seem to do anything useful. Use DepthOffset instead.

SizeMulti {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vectorarrow-up-right SizeMulti {: .copyable aria-label='Variables' }

SpawnerEntity {: aria-label='Variables' }

{: .abp .tooltip .badge }

Entityarrow-up-right SpawnerEntity {: .copyable aria-label='Variables' }

SpawnerType {: aria-label='Variables' }

{: .abp .tooltip .badge }

EntityTypearrow-up-right SpawnerType {: .copyable aria-label='Variables' }

SpawnerVariant {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

SpawnGridIndex {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

SplatColor {: aria-label='Variables' }

{: .abp .tooltip .badge }

Colorarrow-up-right SplatColor {: .copyable aria-label='Variables' }

SpriteOffset {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vectorarrow-up-right SpriteOffset {: .copyable aria-label='Variables' }

SpriteRotation {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

SpriteScale {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vectorarrow-up-right SpriteScale {: .copyable aria-label='Variables' }

SubType {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Target {: aria-label='Variables' }

{: .abp .tooltip .badge }

Entityarrow-up-right Target {: .copyable aria-label='Variables' }

TargetPosition {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vectorarrow-up-right TargetPosition {: .copyable aria-label='Variables' }

Type {: aria-label='Variables' }

{: .abp .tooltip .badge }

EntityTypearrow-up-right Type {: .copyable aria-label='Variables' }

Variant {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Velocity {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vectorarrow-up-right Velocity {: .copyable aria-label='Variables' }

Visible {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Size {: aria-label='Variables' }

{: .abp .tooltip .badge }

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

Returns the size of the hitbox on an entity.

Last updated

Was this helpful?