Class "Entity"
Last updated
Was this helpful?
Last updated
Was this helpful?
{: .abp .tooltip .badge }
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.
{: .abp .tooltip .badge }
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.
Adds a confusion effect to an entity.
???- example "Example Code" This code confuses every entity in the room for 1 second while ignoring bosses.
???- example "Example Code" This code adds slowing and confusion to the enetity.
Adds a fear-effect to an entity.
???- example "Example Code" This code frightens every entity in the room for 1 second.
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.
Heals an entity.
Turns the entity into a gold statue (can't move, can't attack, drops coins when killed)
Adds a poison effect to the entity.
Adds a shrink effect to the entity.
Makes the friction higher.
Adds velocity to the entity. This can be used to move him in a certain direktion (for example as a result of collision)
Explodes with gibs and blood.
enemies keep the doors shut.
Returns true, if the entity is able to collide with the grid.
Kills the entity and trigger its death animation.
Returns true, if this entity still exists.
If the entity is a boss, it returns its specific boss id. If it isnt a boss it will return 0.
Returns the Color object assosiated to this entity.
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.
Returns the assigned RNG object for the entity. This RNG is used to determine the items that are dropped on the entities death.
Returns the last entity spawned by this entity.
Returns the last parent of this entity.
Return the sprite object of the entity.
???- 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.
return true for non background NPCs (ex: every enemy except fire and shopkeepers)
bosses display health bar
return true for NPCs that are not controlled by the player
true every X frames
return true for enemies that can be damaged
Kills the entity and makes a blood splat or gibs.
Remove the entity from the game instantly, without doing any additional effects/animations.
Removes all Status Effects from the entity.
Render the current sprite of the Entity at the current entity position + offset.
Render the shadow / shadow layer again.
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.
Set the size ofthe entity.
???- 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.
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.
Get/set the Seed of the Drop RNG.
loaded from entity config
???- 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.
???+ bug "Bugs" This variable doesnt seem to do anything useful. Use DepthOffset instead.
Returns the size of the hitbox on an entity.
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
Add 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.
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
Removes all from the entity.
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
Get the of 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 .
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
Returns true, if the entity has all named set.
???- example "Example Code" This code prints something in the console, if the entity has a specific .
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }