Skip to content

Classes ​

Mobile ​

The Mobile class represents a mobile entity in the ClassicUO web client, such as players, NPCs, or creatures. Each mobile entity has attributes such as health, position and stat attributes. Mobile

Extends ​

Extended by ​

Properties ​

_tag ​
ts
_tag: 'Mobile';

direction ​
ts
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 ​
ts
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
  }
}
Inherited from ​

Entity.direction


equippedItems ​
ts
equippedItems: object;

The currently equipped items of the mobile (humanoid/players)

MemberType
armsItem
beardItem
braceletItem
cloakItem
earringsItem
faceItem
glovesItem
hairItem
helmetItem
legsItem
mountItem
necklaceItem
oneHandedItem
pantsItem
ringItem
robeItem
shirtItem
shoesItem
skirtItem
talismanItem
torsoItem
tunicItem
twoHandedItem
waistItem

graphic ​
ts
graphic: number;

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

Example ​
ts
console.log(player.graphic); // e.g. 400
Inherited from ​

Entity.graphic


hits ​
ts
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 ​
ts
const entity = client.findObject(0x991);
if (entity) {
  console.log(entity.hits);
}
Inherited from ​

Entity.hits


hue ​
ts
hue: number;

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

Example ​
ts
const entity = client.findObject(player.equippedItems.robe);
if (entity) {
  console.log(entity.name);
}
Inherited from ​

Entity.hue


inWarMode ​
ts
inWarMode: boolean;

Whether the mobile is currently in War Mode (humanoid)


isDead ​
ts
isDead: boolean;

Whether the mobile is dead


isFemale ​
ts
isFemale: boolean;

Whether the mobile is female, or otherwise male.


isHidden ​
ts
isHidden: boolean;
Inherited from ​

Entity.isHidden


isParalyzed ​
ts
isParalyzed: boolean;

Whether the mobile is currently paralyzed.


isPoisoned ​
ts
isPoisoned: boolean;

Whether the mobile is poisoned (green hued)


isYellowHits ​
ts
isYellowHits: boolean;

Whether the mobiles status is yellow (i.e. Invulnerable)


mana ​
ts
mana: number;

The mobiles current mana. For the player it returns the real value, for other mobiles it is a scale of 1 to 100


maxHits ​
ts
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 ​
ts
const entity = client.findObject(0x991);
if (entity) {
  console.log(entity.maxHits);
}
Inherited from ​

Entity.maxHits


maxMana ​
ts
maxMana: number;

The mobiles maximum mana. For the player it returns the real value, for other mobiles it is a scale of 1 to 100


maxStamina ​
ts
maxStamina: number;

The mobiles maximum stamina. For the player it returns the real value, for other mobiles it is a scale of 1 to 100


name ​
ts
name: string;

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

Example ​
ts
const entity = client.findObject(player.equippedItems.robe);
if (entity) {
  console.log(entity.name);
}
Inherited from ​

Entity.name


notoriety ​
ts
notoriety: Notorieties;

The mobiles Notoriety, i.e. Innocent, Gray, etc.


serial ​
ts
serial: number;
Inherited from ​

Entity.serial


stamina ​
ts
stamina: number;

The mobiles current stamina. For the player it returns the real value, for other mobiles it is a scale of 1 to 100


x ​
ts
x: number;

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

Example ​
ts
const entity = client.findObject(player); // Replace with any other entity serial
console.log(entity.x);
Inherited from ​

Entity.x


y ​
ts
y: number;

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

Example ​
ts
const entity = client.findObject(player);
console.log(entity.y);
Inherited from ​

Entity.y


z ​
ts
z: number;

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

Example ​
ts
const entity = client.findObject(player);
console.log(entity.z);
Inherited from ​

Entity.z