Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ClassicUO/classicuo-web/llms.txt

Use this file to discover all available pages before exploring further.

The Mobile class represents any living entity in the game world — NPCs, creatures, other players, and your own character. It extends the base Entity class (which provides serial, name, graphic, hue, x, y, z, hits, maxHits, and isHidden) and is itself extended by the Player class, which adds character-specific stats. Mobiles are returned by search functions like client.findType(), client.findAllMobilesOfType(), and client.selectEntity().
// Check if the nearest mobile is a sheep and say hello
const sheep = client.findAllMobilesOfType(0xcf);
if (sheep.length > 0) {
  client.headMsg('Baa!', sheep[0], 66);
}
The player global variable is also a Mobile. All properties documented here are available on player in addition to the player-specific stats.

Properties

Identity & Position

PropertyTypeDescription
serialnumberUnique entity serial number.
namestringName of the mobile. Empty string if not yet known to the client.
graphicnumberBody/graphic ID. Returns 0 if off-screen.
huenumberHue/colour. Returns 0 if off-screen.
xnumberCurrent X coordinate. Returns 0 if off-screen.
ynumberCurrent Y coordinate. Returns 0 if off-screen.
znumberCurrent Z coordinate. Returns 0 if off-screen.
Example — read position:
const entity = client.findObject(player);
console.log(entity.x, entity.y, entity.z);

Health, Mana & Stamina

PropertyTypeDescription
hitsnumberCurrent hit points. Returns 0 if unknown or off-screen.
maxHitsnumberMaximum hit points. Returns 0 if unknown or off-screen.
mananumberCurrent mana. Real value for the player; scale of 1–100 for others.
maxMananumberMaximum mana.
staminanumberCurrent stamina. Real value for the player; scale of 1–100 for others.
maxStaminanumberMaximum stamina.
const mob = client.findObject(0x991);
if (mob) {
  console.log(`${mob.name}: ${mob.hits}/${mob.maxHits} HP`);
}

Status Flags

PropertyTypeDescription
isPoisonedbooleantrue if the mobile is poisoned (green hue on health bar).
isYellowHitsbooleantrue if the mobile’s health bar is yellow (Invulnerable).
isHiddenbooleantrue if the mobile is hidden.
isParalyzedbooleantrue if the mobile is currently paralyzed.
isDeadbooleantrue if the mobile is dead.
isFemalebooleantrue if the mobile is female.
inWarModebooleantrue if the mobile is in war mode (humanoid).

Notoriety

notoriety: Notorieties;
The mobile’s notoriety level — Innocent, Gray, Criminal, Enemy, Murderer, etc. Compare using the Notorieties enum.
const mob = client.findObject(0x991);
if (mob && mob.notoriety === Notorieties.Murderer) {
  client.headMsg('Murderer!', player, 33);
}

Direction

direction: number;
The direction the mobile is facing, returned as a number. Returns 0 if not known or off-screen. Compare using the Directions enum, or look up the name via reverse indexing.
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]); // e.g. "East"
  }
}

Equipped Items

equippedItems: {
  arms: Item;       beard: Item;     bracelet: Item;  cloak: Item;
  earrings: Item;   face: Item;      gloves: Item;    hair: Item;
  helmet: Item;     legs: Item;      mount: Item;     necklace: Item;
  oneHanded: Item;  pants: Item;     ring: Item;      robe: Item;
  shirt: Item;      shoes: Item;     skirt: Item;     talisman: Item;
  torso: Item;      tunic: Item;     twoHanded: Item; waist: Item;
}
The equipped items for the mobile across all body/inventory slots. Each slot returns an Item (or undefined if nothing is equipped there).
const robe = client.findObject(player.equippedItems.robe);
if (robe) {
  console.log(robe.name); // e.g. "Robe"
}
You can also use client.findItemOnLayer(serial, Layers.Helmet) as an alternative way to access equipped items by layer.

Inheritance Chain

The Mobile class sits in the middle of the entity hierarchy:
Entity
  └── Mobile
        └── Player
All Entity properties (serial, name, graphic, hue, x, y, z, hits, maxHits, isHidden) are available on every Mobile. The Player class adds character-specific properties such as resistances, gold, skills, and more.

Build docs developers (and LLMs) love