Entity
The Entity class is the base type for world entities tracked by the game.
NOTE
This page documents members declared directly on Entity. Inherited members are available from MemoryAccessor.
Static Methods
static GetClassNameStatic()string
Retrieves the class name static.
Returned:
- string - The requested class name static.
Methods
GetIndex()number
Retrieves the index.
Returned:
- number - The requested index.
GetHandle()number
Retrieves the handle.
Returned:
- number - The requested handle.
GetGameSceneNode()DataView | null
Retrieves the game scene node.
Returned:
- DataView | null - The matching object, or
nullif it is not available.
GetInheritance()string[]
Retrieves the inheritance.
Returned:
- string[] - An array with the matching values.
GetClassName()string
Retrieves the class name.
Returned:
- string - The requested class name.
InheritFrom(className: string)boolean
Checks whether the entity inherits from the specified class name.
classNamestring - The class name to check or query.
Returned:
- boolean - True if the condition is met, false otherwise.
GetHealth()number
Retrieves the health.
Returned:
- number - The requested health.
GetMaxHealth()number
Retrieves the maximum health.
Returned:
- number - The requested maximum health.
IsAlive()boolean
Checks whether it is alive.
Returned:
- boolean - True if the condition is met, false otherwise.
GetAbsOrigin()Vector
Retrieves the abs origin.
Returned:
- Vector - The result of the call.
GetOrigin()Vector
Retrieves the origin.
Returned:
- Vector - The result of the call.
GetRotation()Angle
Retrieves the rotation.
Returned:
- Angle - The result of the call.
GetAbsRotation()Angle
Retrieves the abs rotation.
Returned:
- Angle - The result of the call.
GetScale()number
Retrieves the scale.
Returned:
- number - The requested scale.
SetScale(scale: number)void
Sets the scale.
scalenumber - The scale value.
GetDistance(point: Vector)number
Retrieves the distance.
pointVector - The point to use.
Returned:
- number - The requested distance.
GetDistance2D(point: Vector)number
Retrieves the distance2 d.
pointVector - The point to use.
Returned:
- number - The requested distance2 d.
GetDistanceToEntity(ent: Entity)number
Retrieves the distance to entity.
entEntity - The entity to use.
Returned:
- number - The requested distance to entity.
GetDistance2DToEntity(ent: Entity)number
Retrieves the distance2 dto entity.
entEntity - The entity to use.
Returned:
- number - The requested distance2 dto entity.
IsOnScreen()boolean
Checks whether it is on screen.
Returned:
- boolean - True if the condition is met, false otherwise.
WorldToScreen(onScreenCheck?: boolean)[number, number, boolean]
Transforms the entity position from world space to screen space.
onScreenCheckboolean (optional) - The on screen check.
Returned:
- [number, number, boolean] - The result of the call.
GetTeamNum()number
Retrieves the team num.
Returned:
- number - The requested team num.
IsSameTeam(other: Entity)boolean
Checks whether the entity is on the same team as another entity.
otherEntity - The other.
Returned:
- boolean - True if the condition is met, false otherwise.
IsDormant()boolean
Checks whether it is dormant.
Returned:
- boolean - True if the condition is met, false otherwise.
IsEntity()boolean
Checks whether it is entity.
Returned:
- boolean - True if the condition is met, false otherwise.
IsNPC()this is NPC
Checks whether it is npc.
Returned:
- this is NPC - The result of the call.
IsHero()this is Hero
Checks whether it is hero.
Returned:
- this is Hero - The result of the call.
IsPlayer()this is Player
Checks whether it is player.
Returned:
- this is Player - The result of the call.
IsAbility()this is Ability
Checks whether it is ability.
Returned:
- this is Ability - The result of the call.
IsItem()this is Item
Checks whether it is item.
Returned:
- this is Item - The result of the call.
IsPhysicalItem()this is PhysicalItem
Checks whether it is physical item.
Returned:
- this is PhysicalItem - The result of the call.
IsTree()this is Tree
Checks whether it is tree.
Returned:
- this is Tree - The result of the call.
IsTempTree()this is TempTree
Checks whether it is temp tree.
Returned:
- this is TempTree - The result of the call.
IsRune()this is Rune
Checks whether it is rune.
Returned:
- this is Rune - The result of the call.
IsPositionInRange(position: Vector, range: number, hull?: number)boolean
Checks whether a position is within range of the entity.
positionVector - The position to use.rangenumber - The range value.hullnumber (optional) - The hull radius value.
Returned:
- boolean - True if the condition is met, false otherwise.
IsEntityInRange(entity: Entity, range: number)boolean
Checks whether another entity is within range.
entityEntity - The entity to use.rangenumber - The range value.
Returned:
- boolean - True if the condition is met, false otherwise.
HasModel()this is ModelEntity
Checks whether it has model.
Returned:
- this is ModelEntity - The result of the call.
GetOwner<T = NPC>()T | null
Retrieves the owner.
Returned:
- T | null - The matching object, or
nullif it is not available.
GetOwnerRecursive()Entity | null
Retrieves the owner recursive.
Returned:
- Entity | null - The matching object, or
nullif it is not available.
IsRecursiveOwnedByIndex(index: number)boolean
Checks whether the entity is recursively owned by the specified index.
indexnumber - The index value.
Returned:
- boolean - True if the condition is met, false otherwise.
IsRecursiveOwnedByHandle(handle: number)boolean
Checks whether the entity is recursively owned by the specified handle.
handlenumber - The handle.
Returned:
- boolean - True if the condition is met, false otherwise.
IsOwnedByIndex(index: number)boolean
Checks whether the entity is owned by the specified index.
indexnumber - The index value.
Returned:
- boolean - True if the condition is met, false otherwise.
IsOwnedByHandle(handle: number)boolean
Checks whether the entity is owned by the specified handle.
handlenumber - The handle.
Returned:
- boolean - True if the condition is met, false otherwise.
IsOwnedBy(entity: Entity)boolean
Checks whether the entity is owned by the specified entity.
entityEntity - The entity to use.
Returned:
- boolean - True if the condition is met, false otherwise.
GetEntityName()string
Retrieves the entity name.
Returned:
- string - The requested entity name.
GetDesignerName()string
Retrieves the designer name.
Returned:
- string - The requested designer name.
GetCreationTick()number
Retrieves the creation tick.
Returned:
- number - The requested creation tick.
IsUpdated()boolean
equivalent to ent.GetCreationTick() != GameRules.GetTickCount()
Returned:
- boolean - returns true if entity was created in not current tick
GetModelName()string
Retrieves the model name.
Returned:
- string - The requested model name.
IsTeamSuitable(ent: Entity, teamType: Enum.TeamType)boolean
Checks whether it is team suitable.
entEntity - The entity to use.teamTypeEnum.TeamType - The team selection filter.
Returned:
- boolean - True if the condition is met, false otherwise.
GetEntitiesInRadiusByClass<T extends Entity = Entity>(radius: number, teamType: Enum.TeamType, className: string)Array<T>
Retrieves the entities in radius by class.
radiusnumber - The radius value.teamTypeEnum.TeamType - The team selection filter.classNamestring - The class name to check or query.
Returned:
- Array<T> - An array with the matching values.
GetEntitiesInRadius(radius: number, teamType: Enum.TeamType)Entity[]
Retrieves the entities in radius.
radiusnumber - The radius value.teamTypeEnum.TeamType - The team selection filter.
Returned:
- Entity[] - An array with the matching values.
GetHeroesInRadius(radius: number, teamType: Enum.TeamType)Hero[]
Retrieves the heroes in radius.
radiusnumber - The radius value.teamTypeEnum.TeamType - The team selection filter.
Returned:
- Hero[] - An array with the matching values.
GetUnitsInRadius(radius: number, teamType: Enum.TeamType)NPC[]
Retrieves the units in radius.
radiusnumber - The radius value.teamTypeEnum.TeamType - The team selection filter.
Returned:
- NPC[] - An array with the matching values.
GetTreesInRadius(radius: number, isActive?: boolean)Tree[]
Retrieves the trees in radius.
radiusnumber - The radius value.isActiveboolean (optional) - The is active.
Returned:
- Tree[] - An array with the matching values.
GetTempTreeInRadius(radius: number)TempTree[]
Retrieves the temp tree in radius.
radiusnumber - The radius value.
Returned:
- TempTree[] - An array with the matching values.
GetTreeOrTempTreeInRadius(radius: number)(Tree | TempTree)[]
Retrieves the tree or temp tree in radius.
radiusnumber - The radius value.
Returned:
DrawDebugRadius(radius: number, color: Color, segments?: number)void
Draws a debug radius around the entity.
radiusnumber - The radius value.colorColor - The color value to use.segmentsnumber (optional) - The segment count.