Skip to content

BaseEntity

Base class for entities in the game world.

Type: BaseEntityData

Whether the entity is alive.

Type: boolean

The entity’s auras.

Type: Aura[]

The cell the entity is in.

Type: string

The entity’s current HP.

Type: number

The entity’s max HP.

Type: number

The entity’s state.

Type: EntityState

Retrieves an aura active on the entity.

ParameterTypeDescription
namestringThe aura name.

Returns: Aura | undefined

Whether the entity has the specified aura. If a value is provided, it will check if the aura has the specified value.

ParameterTypeOptionalDefaultDescription
namestringThe aura name.
valuenumber?The value to check.

Returns: boolean

Returns: boolean

Whether the entity’s hp is greater than a value.

ParameterTypeDescription
valuenumberThe value to compare the entity’s hp to.

Returns: boolean

Whether the entity’s hp is less than a value.

ParameterTypeDescription
valuenumberThe value to compare the entity’s hp to.

Returns: boolean

Whether the entity’s hp is greater than a percentage value.

ParameterTypeDescription
valuenumberThe percentage value to compare the entity’s hp to.

Returns: boolean

Whether the entity’s hp is less than a percentage value.

ParameterTypeDescription
valuenumberThe percentage value to compare the entity’s hp to.

Returns: boolean

Whether the entity is idle.

Returns: boolean

Whether the entity is in the specified cell.

ParameterTypeDescription
cellstringThe cell to check.

Returns: boolean

Whether the entity is in combat.

Returns: boolean

Whether the entity is a monster.

Returns: this is Monster

Whether the entity is a player.

Returns: this is Avatar