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 Player class represents your currently logged-in character and is accessible everywhere in your scripts as the global player variable. It extends Mobile, inheriting all entity and mobile properties, and adds player-specific stats such as resistances, skill values, gold, weight, and combat abilities.
while (true) {
  if (player.hits < 50) {
    player.say('I need healing!');
  }
  sleep(500);
}
player is always available as a global variable when a script is running in-game. It extends Mobile, so all Mobile and Entity properties are also available.

Properties

Core Stats

PropertyTypeDescription
hitsnumberCurrent hit points. Returns 0 if entity is off-screen.
maxHitsnumberMaximum hit points.
mananumberCurrent mana (real value for the player).
maxMananumberMaximum mana.
staminanumberCurrent stamina (real value for the player).
maxStaminanumberMaximum stamina.
strengthnumberStrength attribute.
intelligencenumberIntelligence attribute.
dexteritynumberDexterity attribute.
statsCapnumberThe player’s stat cap.

Identity & Economy

PropertyTypeDescription
serialnumberUnique serial of the player.
namestringCharacter name.
goldnumberAmount of gold in the player’s pack.
weightnumberCurrent carried weight.
weightMaxnumberMaximum carry weight.
mapnumberCurrent map/facet index.
tithingPointsnumberCurrent tithing points.
lucknumberLuck stat.
followersnumberCurrent number of followers.
maxFollowersnumberMaximum allowed followers.

Resistances

PropertyTypeDescription
physicalResistancenumberPhysical resistance value.
fireResistancenumberFire resistance value.
coldResistancenumberCold resistance value.
poisonResistancenumberPoison resistance value.
energyResistancenumberEnergy resistance value.
maxPhysicResistencenumberMaximum physical resistance cap.
maxFireResistencenumberMaximum fire resistance cap.
maxColdResistencenumberMaximum cold resistance cap.
maxPoisonResistencenumberMaximum poison resistance cap.
maxEnergyResistencenumberMaximum energy resistance cap.

Combat & Abilities

PropertyTypeDescription
damageMinnumberMinimum weapon damage.
damageMaxnumberMaximum weapon damage.
damageIncreasenumberDamage increase bonus.
hitChanceIncreasenumberHit chance increase bonus.
defenseChanceIncreasenumberDefense chance increase bonus.
maxDefenseChanceIncreasenumberMax defense chance increase cap.
swingSpeedIncreasenumberSwing speed increase bonus.
spellDamageIncreasenumberSpell damage increase bonus.
fasterCastingnumberFaster casting bonus.
fasterCastRecoverynumberFaster cast recovery bonus.
lowerManaCostnumberLower mana cost bonus.
lowerReagentCostnumberLower reagent cost bonus.
primaryAbilityAbilitiesCurrently set primary combat ability.
secondaryAbilityAbilitiesCurrently set secondary combat ability.

Status Flags

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

Equipment & Inventory

The backpack property returns the player’s top-level backpack container. equippedItems exposes every equipment slot as a named property.
backpack: undefined | Item;
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;
}
Example — move your robe to your backpack:
if (player.equippedItems.robe) {
  player.moveItem(player.equippedItems.robe, player.backpack);
}

Position (inherited from Entity)

PropertyTypeDescription
xnumberCurrent X coordinate.
ynumberCurrent Y coordinate.
znumberCurrent Z coordinate.
graphicnumberGraphic/body ID of the player.
huenumberHue/color of the player.
notorietyNotorietiesNotoriety status (Innocent, Gray, etc.).
directionnumberFacing direction. Compare using the Directions enum.

Methods

say()

say(message: string, hue?: number): void
Sends a chat message as your character, with an optional hue.
message
string
required
The text to say in chat.
hue
number
Optional hue/colour for the message text.
player.say('Hello there!');

walk()

walk(direction: Directions): boolean
Walk or turn a single step in the given direction. Returns true if the character can walk.
player.walk(Directions.North);

run()

run(direction: Directions): boolean
Run a single step in the given direction. Returns true if the character can run.
player.run(Directions.South);

use()

use(serial: SerialOrEntity): void
Double-clicks (uses) an object.
serial
SerialOrEntity
required
The item or entity to use.
const dagger = client.findType(0x0f52); // Dagger graphic ID
player.use(dagger);

useType()

useType(graphic: number, hue?: number, sourceSerial?: SerialOrEntity, range?: number): boolean
Finds and uses the first object matching the graphic (and optional hue, source, range).
const myFriend = 0x217ded;
player.useType(0xe21); // Bandage type
target.wait(5000);
target.entity(myFriend);

useItemInHand()

useItemInHand(): void
Uses the item in your left hand first; falls back to the right hand.
player.useItemInHand();

useLastObject()

useLastObject(): void
Re-uses the last object you double-clicked.
player.useLastObject();

equip()

equip(serial: SerialOrEntity): void
Attempts to equip an item.
const axe = client.findType(0x0f49); // Axe graphic ID
player.equip(axe);

moveItem()

moveItem(
  serial: SerialOrEntity,
  container: SerialOrEntity,
  x?: number,
  y?: number,
  z?: number,
  amount?: number
): number
Moves an object from one container to another.
serial
SerialOrEntity
required
The item to move.
container
SerialOrEntity
required
The destination container.
x
number
Optional X placement within the container.
y
number
Optional Y placement within the container.
z
number
Optional Z placement within the container.
amount
number
Amount to move (for stackable items).
if (player.equippedItems.robe) {
  player.moveItem(player.equippedItems.robe, player.backpack);
}

moveType()

moveType(
  graphic: number,
  src: SerialOrEntity,
  dest: SerialOrEntity,
  x?: number,
  y?: number,
  z?: number,
  hue?: number,
  amount?: number,
  range?: number
): number
Moves an object of a specific graphic type between containers.
player.moveType(0x0f52, player.backpack, bag);

moveItemOnGroundOffset()

moveItemOnGroundOffset(
  serial: SerialOrEntity,
  x?: number,
  y?: number,
  z?: number,
  amount?: number
): number
Moves an item on the ground using an offset from its current position.
const targetInfo = target.query();
if (targetInfo) {
  player.moveItemOnGroundOffset(targetInfo, 1, 0, 0); // Move item one tile east
}

attack()

attack(serial: SerialOrEntity): void
Attacks a mobile.
player.attack(target.lastSerial);

cast()

cast(spell: any): void
Casts a spell.
player.cast(Spells.Agility);
target.wait();
target.entity(player);

castTo()

castTo(spell: any, serial: SerialOrEntity, timeout?: number): void
Casts a spell and automatically targets the given entity.
player.castTo(Spells.Heal, player);

useSkill()

useSkill(skill: any, target?: SerialOrEntity, timeout?: number): void
Activates a skill, optionally targeting an entity.
player.useSkill(Skills.Meditation);

useVirtue()

useVirtue(virtue: any, target?: SerialOrEntity, timeout?: number): void
Activates a virtue, optionally targeting an entity.
player.useVirtue(Virtues.Honor);

getSkill()

getSkill(skill: Skills): undefined | object
Returns the current values for a specific skill. The value is stored as an integer — e.g. 74.6 skill becomes 746.
const anatomySkill = player.getSkill(Skills.Anatomy).value;

getAllSkills()

getAllSkills(): undefined | object[]
Returns an array of all skill value objects.
const skills = player.getAllSkills();
console.log(skills[0].value); // Print Alchemy skill value

setSkillLock()

setSkillLock(skill: Skills, lock: SkillLock): void
Sets the lock state of a skill (Up, Down, or Locked).
player.setSkillLock(Skills.Anatomy, SkillLock.Down);

setAbility()

setAbility(primary: boolean, active: boolean): void
Toggles a primary or secondary combat ability on or off.
primary
boolean
required
true for primary ability, false for secondary.
active
boolean
required
true to activate, false to deactivate.
player.setAbility(true, false);  // Turn primary ability off
player.setAbility(false, true);  // Turn secondary ability on

hasBuffDebuff()

hasBuffDebuff(buffID: BuffDebuffs): boolean
Returns true if the player currently has the given buff or debuff active.

waitForBuffDebuff()

waitForBuffDebuff(buffId: BuffDebuffs, timeoutMs?: number): null | boolean
Waits until the specified buff/debuff appears or the timeout is reached.

toggleWarMode()

toggleWarMode(): void
Toggles war mode on or off.
player.toggleWarMode();

toggleFlying()

toggleFlying(): void
Toggles flying (Gargoyle characters only).
player.toggleFlying();

fly() / land()

fly(): void
land(): void
Engage or disengage flight for Gargoyle characters.
player.fly();
// ... later
player.land();

openDoor()

openDoor(): void
Uses the door directly in front of the player.
player.openDoor();

click()

click(serial: SerialOrEntity): void
Simulates a single-click on an object (shows name overhead).
player.click(player);

moveTypeOnGroundOffset()

moveTypeOnGroundOffset(
  graphic: number,
  src: SerialOrEntity,
  x?: number,
  y?: number,
  z?: number,
  hue?: number,
  amount?: number,
  range?: number
): number
Moves an object of a specific graphic type from a source container onto the ground using an offset position.
player.moveTypeOnGroundOffset(0x0f52, player.backpack);

dressKr()

dressKr(items: (number | Item)[]): void
Dresses the given items using the KR (Kingdom Reborn) dress/undress system.
items
(number | Item)[]
required
Array of item serials or Item objects to dress.

undressKr()

undressKr(layers: Layers[]): void
Undresses items on the specified layers using the KR dress/undress system.
layers
Layers[]
required
Array of layer values to undress.

bow() / salute()

bow(): void
salute(): void
Perform the Bow or Salute emote.
player.bow();
player.salute();

Build docs developers (and LLMs) love