ClassicUO Logo

#Class: Mobile

Mobile.Mobile

#Hierarchy

#Accessors

#serial

get serial(): number

#Returns

number

#Inherited from

Entity.serial


#graphic

get graphic(): number

Gets the graphic id of the entity. Returns 0 if entity is no longer on screen.

Example

console.log(player.graphic); // e.g. 400

#Returns

number

#Inherited from

Entity.graphic


#x

get x(): number

Gets the current X coordinate of the entity. Returns 0 if entity is no longer on screen.

Example

const entity = client.findObject(player); // Replace with any other entity serial
console.log(entity.x)

#Returns

number

#Inherited from

Entity.x


#y

get y(): number

Gets the current Y coordinate of the entity. Returns 0 if entity is no longer on screen.

Example

const entity = client.findObject(player);
console.log(entity.y)

#Returns

number

#Inherited from

Entity.y


#z

get z(): number

Gets the current Z coordinate of the entity. Returns 0 if entity is no longer on screen.

Example

const entity = client.findObject(player);
console.log(entity.z)

#Returns

number

#Inherited from

Entity.z


#name

get name(): string

Gets the name of the entity. Returns an empty string if not known to the client yet.

Example

const entity = client.findObject(player.equippedItems.robe);
if(entity) {
 console.log(entity.name);
}

#Returns

string

#Inherited from

Entity.name


#hue

get hue(): number

Gets the hue/color of the entity. Returns 0 if entity is no longer on screen.

Example

const entity = client.findObject(player.equippedItems.robe);
if(entity) {
 console.log(entity.name);
}

#Returns

number

#Inherited from

Entity.hue


#hits

get hits(): number

Gets the hits of the entity. Returns 0 if the client does not know (e.g. item.hits) or the entity is no longer on screen.

Example

const entity = client.findObject(0x991);
if(entity) {
 console.log(entity.hits);
}

#Returns

number

#Inherited from

Entity.hits


#maxHits

get maxHits(): number

Gets the maxHits of the entity. Returns 0 if the client does not know (e.g. item.maxHits) or the entity is no longer on screen.

Example

const entity = client.findObject(0x991);
if(entity) {
 console.log(entity.maxHits);
}

#Returns

number

#Inherited from

Entity.maxHits


#direction

get direction(): number

Gets the direction of the entity as a number, if it has one. Returns 0 if the client does not know (e.g. item.maxHits) or the entity is no longer on screen.

Compare using the Directions enum.

Example

const entity = client.findObject(0x991);
if(entity) {
  if(entity.direction === Directions.North) {
    console.log(`${entity.name} is facing North`);
  }
  else {
    console.log(Directions[entity.direction]); // Prints the directions name, e.g. East
  }
}

#Returns

number

#Inherited from

Entity.direction


#isHidden

get isHidden(): boolean

#Returns

boolean

#Inherited from

Entity.isHidden


#stamina

get stamina(): number

#Returns

number


#maxStamina

get maxStamina(): number

#Returns

number


#mana

get mana(): number

#Returns

number


#maxMana

get maxMana(): number

#Returns

number


#isPoisoned

get isPoisoned(): boolean

#Returns

boolean


#isYellowHits

get isYellowHits(): boolean

#Returns

boolean


#isFemale

get isFemale(): boolean

#Returns

boolean


#notoriety

get notoriety(): Notorieties

#Returns

Notorieties


#inWarMode

get inWarMode(): boolean

#Returns

boolean


#isParalyzed

get isParalyzed(): boolean

#Returns

boolean


#isDead

get isDead(): boolean

#Returns

boolean


#equippedItems

get equippedItems(): Object

#Returns

Object

Name Type
shirt? Item
pants? Item
shoes? Item
legs? Item
torso? Item
ring? Item
talisman? Item
bracelet? Item
face? Item
arms? Item
gloves? Item
skirt? Item
tunic? Item
robe? Item
necklace? Item
hair? Item
waist? Item
beard? Item
earrings? Item
oneHanded? Item
helmet? Item
twoHanded? Item
cloak? Item
mount? Item

#Methods

#serialFrom

Static serialFrom(value): number

#Parameters

Name Type
value any

#Returns

number

#Inherited from

Entity.serialFrom