Skip to content

Class "Entity"⚓︎

Functions⚓︎

AddBaited ()⚓︎

void AddBaited ( EntityRef Source, int Duration )⚓︎


AddBleeding ()⚓︎

void AddBleeding ( EntityRef Source, int Duration )⚓︎


AddBrimstoneMark ()⚓︎

void AddBrimstoneMark ( EntityRef Source, int Duration )⚓︎


AddIce ()⚓︎

void AddIce ( EntityRef Source, int Duration )⚓︎


AddKnockback ()⚓︎

void AddKnockback ( EntityRef Source, Vector PushDirection, int Duration, boolean TakeImpactDamage )⚓︎

Duration info

The Duration has a maximum of 0.5 seconds / 15 frames.


AddMagnetized ()⚓︎

void AddMagnetized ( EntityRef Source, int Duration )⚓︎


AddWeakness ()⚓︎

void AddWeakness ( EntityRef Source, int Duration )⚓︎


ComputeStatusEffectDuration ()⚓︎

int ComputeStatusEffectDuration ( int InitialLength, EntityRef Source )⚓︎


CopyStatusEffects ()⚓︎

void CopyStatusEffects ( Entity Target, boolean Overwrite = false )⚓︎

If Target is left unspecified, this will recursively copy status effects to all Child Entities. Overwrite will additionally remove all other status effects from the target and set the properties of existing effects to match the entity.


ForceCollide ()⚓︎

boolean ForceCollide ( Entity Entity, boolean Low )⚓︎


GetBaitedCountdown ()⚓︎

int GetBaitedCountdown ( )⚓︎


GetBleedingCountdown ()⚓︎

int GetBleedingCountdown ( )⚓︎


GetBossStatusEffectCooldown ()⚓︎

int GetBossStatusEffectCooldown ( )⚓︎


GetBrimstoneMarkCountdown ()⚓︎

int GetBrimstoneMarkCountdown ( )⚓︎


GetBurnCountdown ()⚓︎

int GetBurnCountdown ( )⚓︎


GetBurnDamageTimer ()⚓︎

int GetBurnDamageTimer ( )⚓︎


GetCharmedCountdown ()⚓︎

int GetCharmedCountdown ( )⚓︎


GetCollisionCapsule ()⚓︎

Capsule GetCollisionCapsule ( Vector Vector )⚓︎


GetColorParams ()⚓︎

ColorParams[] GetColorParams ( )⚓︎

Returns a table of all colors currently queued by SetColor alongside their parameters.


GetConfusionCountdown ()⚓︎

int GetConfusionCountdown ( )⚓︎


GetDamageCountdown ()⚓︎

int GetDamageCountdown ( )⚓︎

If the entity recently took damage with the DAMAGE_COUNTDOWN DamageFlag, this returns how many more frames must pass before they can take damage with the DAMAGE_COUNTDOWN DamageFlag again.

Note that this is NOT the same as the player's invincibility frames (EntityPlayer:GetDamageCooldown()). The DAMAGE_COUNTDOWN DamageFlag and this associated countdown are typically used to control how rapidly an enemy will take damage from the few sources that uses that flag, such as the the collision damage effects from the "My Little Unicorn", "The Nail", and "The Gamekid".


GetDebugShape ()⚓︎

Shape GetDebugShape ( boolean Unknown )⚓︎


GetEntityConfigEntity ()⚓︎

EntityConfigEntity GetEntityConfigEntity ( )⚓︎

Returns the corresponding EntityConfig entry for this entity.


GetFearCountdown ()⚓︎

int GetFearCountdown ( )⚓︎


GetFireDamageCooldown ()⚓︎

int GetFireDamageCooldown ( )⚓︎


GetFreezeCountdown ()⚓︎

int GetFreezeCountdown ( )⚓︎


GetHitListIndex ()⚓︎

int GetHitListIndex ( )⚓︎


GetIceCountdown ()⚓︎

int GetIceCountdown ( )⚓︎


GetKnockbackCountdown ()⚓︎

int GetKnockbackCountdown ( )⚓︎


GetKnockbackDirection ()⚓︎

Vector GetKnockbackDirection ( )⚓︎


GetMagnetizedCountdown ()⚓︎

int GetMagnetizedCountdown ( )⚓︎


GetMidasFreezeCountdown ()⚓︎

int GetMidasFreezeCountdown ( )⚓︎


GetMinecart ()⚓︎

EntityNPC GetMinecart ( )⚓︎

Returns the minecart the entity is riding.

Return behavior

If the entity is not riding a minecart, this function returns nil.


GetNullCapsule ()⚓︎

Capsule GetNullCapsule ( string NullLayerName )⚓︎


GetNullOffset ()⚓︎

Vector GetNullOffset ( string NullLayerName )⚓︎

Returns position of null layer mark. Alternatively returns Vector.Zero if the layer is not visible, has no frame available for the current animation, or for other unknown reasons.


GetPauseTime ()⚓︎

int GetPauseTime ( )⚓︎


GetPoisonCountdown ()⚓︎

int GetPoisonCountdown ( )⚓︎


GetPoisonDamageTimer ()⚓︎

int GetPoisonDamageTimer ( )⚓︎


GetPosVel ()⚓︎

PosVel GetPosVel ( )⚓︎

Returns 2 values, both Vectors. 1st the Position of the entity, 2nd the Velocity of the entity.


GetPredictedTargetPosition ()⚓︎

Vector GetPredictedTargetPosition ( Entity Target, float Delay )⚓︎

The prediction is the target's current position plus their velocity multiplied by the distance between this and the target. Delay acts as a multiplier for how far ahead the prediction should be. For example, 1.0 would predict where the target's velocity would place them on the next update.


GetShadowSize ()⚓︎

float GetShadowSize ( )⚓︎


GetShrinkCountdown ()⚓︎

int GetShrinkCountdown ( )⚓︎


GetSlowingCountdown ()⚓︎

int GetSlowingCountdown ( )⚓︎


GetSpeedMultiplier ()⚓︎

float GetSpeedMultiplier ( )⚓︎


GetType ()⚓︎

EntityType GetType ( )⚓︎


GetWeaknessCountdown ()⚓︎

int GetWeaknessCountdown ( )⚓︎


GiveMinecart ()⚓︎

EntityNPC GiveMinecart ( Vector Position, Vector Velocity )⚓︎


IgnoreEffectFromFriendly ()⚓︎

boolean IgnoreEffectFromFriendly ( EntityRef Source )⚓︎

Used to determine if this entity should ignore any status effect coming from Source.


MakeBloodPoof ()⚓︎

EntityEffect MakeBloodPoof ( Vector Position = self.Position, Color Color = default, float Scale = 1.0 )⚓︎

This function spawns two blood poof effects of subtypes 3 and 4; the second of which will be the the Child of the one returned.


MakeGroundPoof ()⚓︎

EntityEffect MakeGroundPoof ( Vector Position = self.Position, Color Color = default, float Scale = 1.0 )⚓︎

This function spawns two dust poof effects of subtypes 1 and 2; the second of which will be the the Child of the one returned.


SetBaitedCountdown ()⚓︎

void SetBaitedCountdown ( int Countdown )⚓︎


SetBleedingCountdown ()⚓︎

void SetBleedingCountdown ( int Countdown )⚓︎


SetBossStatusEffectCooldown ()⚓︎

void SetBossStatusEffectCooldown ( int Cooldown )⚓︎


SetBrimstoneMarkCountdown ()⚓︎

void SetBrimstoneMarkCountdown ( int Countdown )⚓︎


SetBurnCountdown ()⚓︎

void SetBurnCountdown ( int Countdown )⚓︎


SetBurnDamageTimer ()⚓︎

void SetBurnDamageTimer ( int Timer )⚓︎


SetCharmedCountdown ()⚓︎

void SetCharmedCountdown ( int Countdown )⚓︎


SetColorParams ()⚓︎

void SetColorParams ( ColorParams[] Params )⚓︎

Sets colors to be used alongside their parameters.


SetConfusionCountdown ()⚓︎

void SetConfusionCountdown ( int Countdown )⚓︎


SetDamageCountdown ()⚓︎

void SetDamageCountdown ( int countdown )⚓︎

Sets how many frames must pass before the entity can take damage that has the DAMAGE_COUNTDOWN DamageFlag.

Note that this is NOT the same as the player's invincibility frames (EntityPlayer:GetDamageCooldown()). The DAMAGE_COUNTDOWN DamageFlag and this associated countdown are typically used to control how rapidly an enemy will take damage from the few sources that uses that flag, such as the the collision damage effects from the "My Little Unicorn", "The Nail", and "The Gamekid".


SetDead ()⚓︎

void SetDead ( boolean IsDead )⚓︎


SetFearCountdown ()⚓︎

void SetFearCountdown ( int Countdown )⚓︎


SetFireDamageCooldown ()⚓︎

void SetFireDamageCooldown ( int Cooldown )⚓︎


SetFreezeCountdown ()⚓︎

void SetFreezeCountdown ( int Countdown )⚓︎


SetIceCountdown ()⚓︎

void SetIceCountdown ( int Countdown )⚓︎


SetInvincible ()⚓︎

void SetInvincible ( boolean IsInvincible )⚓︎


SetKnockbackCountdown ()⚓︎

void SetKnockbackCountdown ( int Countdown )⚓︎


SetKnockbackDirection ()⚓︎

void SetKnockbackDirection ( Vector Direction )⚓︎


SetMagnetizedCountdown ()⚓︎

void SetMagnetizedCountdown ( int Countdown )⚓︎


SetMidasFreezeCountdown ()⚓︎

void SetMidasFreezeCountdown ( int Countdown )⚓︎


SetPauseTime ()⚓︎

void SetPauseTime ( int Duration )⚓︎


SetPoisonCountdown ()⚓︎

void SetPoisonCountdown ( int Countdown )⚓︎


SetPoisonDamageTimer ()⚓︎

void SetPoisonDamageTimer ( int Timer )⚓︎


SetShadowSize ()⚓︎

float SetShadowSize ( float Size )⚓︎


SetShrinkCountdown ()⚓︎

void SetShrinkCountdown ( int Countdown )⚓︎


SetSlowingCountdown ()⚓︎

void SetSlowingCountdown ( int Countdown )⚓︎


SetSpeedMultiplier ()⚓︎

void SetSpeedMultiplier ( float Amount )⚓︎


SetWeaknessCountdown ()⚓︎

void SetWeaknessCountdown ( int Countdown )⚓︎


SpawnBloodEffect ()⚓︎

EntityEffect SpawnBloodEffect ( int SubType = 0, Vector position = self.Position, Vector Offset = Vector.Zero, Color Color = Default, Vector Velocity = Vector.Zero )⚓︎


SpawnWaterImpactEffects ()⚓︎

void SpawnWaterImpactEffects ( Vector Position, Vector Velocity = Vector.Zero, float Strength )⚓︎

Warning

This function will only spawn effects if the Room's water amount is above or equal to 0.2.


TeleportToRandomPosition ()⚓︎

void TeleportToRandomPosition ( )⚓︎


ToDelirium ()⚓︎

EntityDelirium ToDelirium ( )⚓︎

Convert an Entity userdata to an EntityDelirium userdata. The conversion will only succeed if the source entity is an instance of Delirium (in its normal form or in a transformed form).

Return behavior

If the conversion fails, this function returns nil.


ToSlot ()⚓︎

EntitySlot ToSlot ( )⚓︎

Used to cast an Entity object to an EntitySlot object.

Return behavior

If the conversion is not successful, this function returns nil.


TryThrow ()⚓︎

boolean TryThrow ( EntityRef Source, Vector ThrowDirection, float Force )⚓︎