Class "Entity"
Functions
AddBurn () {: aria-label='Functions' }
void AddBurn ( EntityRef 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.
AddCharmed () {: aria-label='Functions' }
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' }
void AddConfusion ( EntityRef 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' }
void AddEntityFlags ( int Flags ) {: .copyable aria-label='Functions' }
Add EntityFlags 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' }
void AddFear ( EntityRef 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' }
void AddFreeze ( EntityRef 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' }
void AddHealth ( float HitPoints ) {: .copyable aria-label='Functions' }
Heals an entity.
AddMidasFreeze () {: aria-label='Functions' }
void AddMidasFreeze ( EntityRef 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' }
void AddPoison ( EntityRef Source, int Duration, float Damage ) {: .copyable aria-label='Functions' }
Adds a poison effect to the entity.
AddShrink () {: aria-label='Functions' }
void AddShrink ( EntityRef Source, int Duration ) {: .copyable aria-label='Functions' }
Adds a shrink effect to the entity.
AddSlowing () {: aria-label='Functions' }
Makes the friction higher.
AddVelocity () {: aria-label='Functions' }
void AddVelocity ( Vector 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' }
void BloodExplode ( ) {: .copyable aria-label='Functions' }
Explodes with gibs and blood.
CanShutDoors () {: aria-label='Functions' }
boolean CanShutDoors ( ) {: .copyable aria-label='Functions' }
enemies keep the doors shut.
ClearEntityFlags () {: aria-label='Functions' }
void ClearEntityFlags ( int Flags ) {: .copyable aria-label='Functions' }
Removes all EntityFlags from the entity.
CollidesWithGrid () {: aria-label='Functions' }
boolean CollidesWithGrid ( ) {: .copyable aria-label='Functions' }
Returns true, if the entity is able to collide with the grid.
Die () {: aria-label='Functions' }
void Die ( ) {: .copyable aria-label='Functions' }
Kills the entity and trigger its death animation.
Exists () {: aria-label='Functions' }
boolean Exists ( ) {: .copyable aria-label='Functions' }
Returns true, if this entity still exists.
GetBossID () {: aria-label='Functions' }
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' }
Color GetColor ( ) {: .copyable aria-label='Functions' }
Returns the Color object assosiated to this entity.
GetData () {: aria-label='Functions' }
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' }
RNG 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' }
int GetEntityFlags ( ) {: .copyable aria-label='Functions' }
Get the EntityFlagsof 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 EntityFlags.
GetLastChild () {: aria-label='Functions' }
Entity GetLastChild ( ) {: .copyable aria-label='Functions' }
Returns the last entity spawned by this entity.
GetLastParent () {: aria-label='Functions' }
Entity GetLastParent ( ) {: .copyable aria-label='Functions' }
Returns the last parent of this entity.
GetSprite () {: aria-label='Functions' }
Sprite GetSprite ( ) {: .copyable aria-label='Functions' }
Return the sprite object of the entity.
HasCommonParentWithEntity () {: aria-label='Functions' }
boolean HasCommonParentWithEntity ( Entity Other ) {: .copyable aria-label='Functions' }
HasEntityFlags () {: aria-label='Functions' }
boolean HasEntityFlags ( int Flags ) {: .copyable aria-label='Functions' }
Returns true, if the entity has all named EntityFlags set.
???- example "Example Code" This code prints something in the console, if the entity has a specific EntityFlags.
HasFullHealth () {: aria-label='Functions' }
boolean HasFullHealth ( ) {: .copyable aria-label='Functions' }
HasMortalDamage () {: aria-label='Functions' }
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' }
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' }
boolean IsBoss ( ) {: .copyable aria-label='Functions' }
bosses display health bar
IsDead () {: aria-label='Functions' }
boolean IsDead ( ) {: .copyable aria-label='Functions' }
IsEnemy () {: aria-label='Functions' }
boolean IsEnemy ( ) {: .copyable aria-label='Functions' }
return true for NPCs that are not controlled by the player
IsFlying () {: aria-label='Functions' }
boolean IsFlying ( ) {: .copyable aria-label='Functions' }
IsFrame () {: aria-label='Functions' }
boolean IsFrame ( int Frame, int Offset ) {: .copyable aria-label='Functions' }
true every X frames
IsInvincible () {: aria-label='Functions' }
boolean IsInvincible ( ) {: .copyable aria-label='Functions' }
IsVisible () {: aria-label='Functions' }
boolean IsVisible ( ) {: .copyable aria-label='Functions' }
IsVulnerableEnemy () {: aria-label='Functions' }
boolean IsVulnerableEnemy ( ) {: .copyable aria-label='Functions' }
return true for enemies that can be damaged
Kill () {: aria-label='Functions' }
void Kill ( ) {: .copyable aria-label='Functions' }
Kills the entity and makes a blood splat or gibs.
MultiplyFriction () {: aria-label='Functions' }
void MultiplyFriction ( float Value ) {: .copyable aria-label='Functions' }
PostRender () {: aria-label='Functions' }
void PostRender ( ) {: .copyable aria-label='Functions' }
Remove () {: aria-label='Functions' }
void Remove ( ) {: .copyable aria-label='Functions' }
Remove the entity from the game instantly, without doing any additional effects/animations.
RemoveStatusEffects () {: aria-label='Functions' }
void RemoveStatusEffects ( ) {: .copyable aria-label='Functions' }
Removes all Status Effects from the entity.
Render () {: aria-label='Functions' }
void Render ( Vector Offset ) {: .copyable aria-label='Functions' }
Render the current sprite of the Entity at the current entity position + offset.
RenderShadowLayer () {: aria-label='Functions' }
boolean RenderShadowLayer ( Vector Offset ) {: .copyable aria-label='Functions' }
Render the shadow / shadow layer again.
SetColor () {: aria-label='Functions' }
void SetColor ( Color 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' }
void SetSize ( float Size, Vector SizeMulti, int NumGridCollisionPoints ) {: .copyable aria-label='Functions' }
Set the size ofthe entity.
SetSpriteFrame () {: aria-label='Functions' }
void SetSpriteFrame ( string AnimationName, int FrameNum ) {: .copyable aria-label='Functions' }
SetSpriteOverlayFrame () {: aria-label='Functions' }
void SetSpriteOverlayFrame ( string AnimationName, int FrameNum ) {: .copyable aria-label='Functions' }
TakeDamage () {: aria-label='Functions' }
boolean TakeDamage ( float Damage, int Flags, EntityRef 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' }
EntityBomb ToBomb ( ) {: .copyable aria-label='Functions' }
ToEffect () {: aria-label='Functions' }
EntityEffect ToEffect ( ) {: .copyable aria-label='Functions' }
ToFamiliar () {: aria-label='Functions' }
EntityFamiliar ToFamiliar ( ) {: .copyable aria-label='Functions' }
ToKnife () {: aria-label='Functions' }
EntityKnife ToKnife ( ) {: .copyable aria-label='Functions' }
ToLaser () {: aria-label='Functions' }
EntityLaser ToLaser ( ) {: .copyable aria-label='Functions' }
ToNPC () {: aria-label='Functions' }
EntityNPC ToNPC ( ) {: .copyable aria-label='Functions' }
ToPickup () {: aria-label='Functions' }
EntityPickup ToPickup ( ) {: .copyable aria-label='Functions' }
ToPlayer () {: aria-label='Functions' }
EntityPlayer ToPlayer ( ) {: .copyable aria-label='Functions' }
ToProjectile () {: aria-label='Functions' }
EntityProjectile ToProjectile ( ) {: .copyable aria-label='Functions' }
ToTear () {: aria-label='Functions' }
EntityTear ToTear ( ) {: .copyable aria-label='Functions' }
Update () {: aria-label='Functions' }
void Update ( ) {: .copyable aria-label='Functions' }
Child () {: aria-label='Functions' }
Entity Child {: .copyable aria-label='Functions' }
Variables
CollisionDamage {: aria-label='Variables' }
float CollisionDamage {: .copyable aria-label='Variables' }
DepthOffset {: aria-label='Variables' }
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' }
int DropSeed {: .copyable aria-label='Variables' }
Get/set the Seed of the Drop RNG.
EntityCollisionClass {: aria-label='Variables' }
EntityCollisionClass EntityCollisionClass {: .copyable aria-label='Variables' }
FlipX {: aria-label='Variables' }
boolean FlipX {: .copyable aria-label='Variables' }
FrameCount {: aria-label='Variables' }
int FrameCount {: .copyable aria-label='Variables' }
Friction {: aria-label='Variables' }
float Friction {: .copyable aria-label='Variables' }
loaded from entity config
GridCollisionClass {: aria-label='Variables' }
GridCollisionClass GridCollisionClass {: .copyable aria-label='Variables' }
HitPoints {: aria-label='Variables' }
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' }
int Index {: .copyable aria-label='Variables' }
InitSeed {: aria-label='Variables' }
int InitSeed {: .copyable aria-label='Variables' }
Mass {: aria-label='Variables' }
float Mass {: .copyable aria-label='Variables' }
MaxHitPoints {: aria-label='Variables' }
float MaxHitPoints {: .copyable aria-label='Variables' }
Parent {: aria-label='Variables' }
Entity Parent {: .copyable aria-label='Variables' }
Position {: aria-label='Variables' }
Vector Position {: .copyable aria-label='Variables' }
PositionOffset {: aria-label='Variables' }
Vector PositionOffset {: .copyable aria-label='Variables' }
RenderZOffset {: aria-label='Variables' }
int RenderZOffset {: .copyable aria-label='Variables' }
???+ bug "Bugs" This variable doesnt seem to do anything useful. Use DepthOffset instead.
SizeMulti {: aria-label='Variables' }
Vector SizeMulti {: .copyable aria-label='Variables' }
SpawnerEntity {: aria-label='Variables' }
Entity SpawnerEntity {: .copyable aria-label='Variables' }
SpawnerType {: aria-label='Variables' }
EntityType SpawnerType {: .copyable aria-label='Variables' }
SpawnerVariant {: aria-label='Variables' }
int SpawnerVariant {: .copyable aria-label='Variables' }
SpawnGridIndex {: aria-label='Variables' }
int SpawnGridIndex {: .copyable aria-label='Variables' }
SplatColor {: aria-label='Variables' }
Color SplatColor {: .copyable aria-label='Variables' }
SpriteOffset {: aria-label='Variables' }
Vector SpriteOffset {: .copyable aria-label='Variables' }
SpriteRotation {: aria-label='Variables' }
float SpriteRotation {: .copyable aria-label='Variables' }
SpriteScale {: aria-label='Variables' }
Vector SpriteScale {: .copyable aria-label='Variables' }
SubType {: aria-label='Variables' }
int SubType {: .copyable aria-label='Variables' }
Target {: aria-label='Variables' }
Entity Target {: .copyable aria-label='Variables' }
TargetPosition {: aria-label='Variables' }
Vector TargetPosition {: .copyable aria-label='Variables' }
Type {: aria-label='Variables' }
EntityType Type {: .copyable aria-label='Variables' }
Variant {: aria-label='Variables' }
int Variant {: .copyable aria-label='Variables' }
Velocity {: aria-label='Variables' }
Vector Velocity {: .copyable aria-label='Variables' }
Visible {: aria-label='Variables' }
boolean Visible {: .copyable aria-label='Variables' }
Size {: aria-label='Variables' }
float Size {: .copyable aria-label='Variables' }
Returns the size of the hitbox on an entity.
Last updated