Appearance
sdk.player
Snapshot wrapper for any creature (player, NPC, monster). Reads only; actions live on LocalPlayer. Kind is ClassifyKind (id band + npc/monster catalogs) plus the live TCreature.kind byte.
lua
local M = require("sdk.player")new
function · new(data)
Wrap a snapshot table as a Player.
id
method · id(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
name
method · name(self: Player): string?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
string? | — |
health
method · health(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
maxHealth
method · maxHealth(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
mana
method · mana(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
maxMana
method · maxMana(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
level
method · level(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
vocationClientId
method · vocationClientId(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
vocation
method · vocation(self: Player): string?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
string? | — |
experience
method · experience(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
levelPercent
method · levelPercent(self: Player): Percent?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
Percent? | — |
soul
method · soul(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
capacity
method · capacity(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
speed
method · speed(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
food
method · food(self: Player): integer?
Remaining food time in seconds, when known.
Returns
| Type | Summary |
|---|---|
integer? | — |
stamina
method · stamina(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
offlineTraining
method · offlineTraining(self: Player): table?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
table? | — |
xpGain
method · xpGain(self: Player): integer?
Client stores four floats (base, grinding, boost, stamina). Returned percents are * 100; rate = (base + grinding + boost) * stamina * 100.
Returns
| Type | Summary |
|---|---|
integer? | — |
xpGainRate
method · xpGainRate(self: Player): number?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
number? | — |
xpBoost
method · xpBoost(self: Player): table?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
table? | — |
manaShield
method · manaShield(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
healthPercent
method · healthPercent(self: Player): Percent?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
Percent? | — |
isDead
method · isDead(self: Player): boolean|nil
Return whether the creature is dead, preserving unknown snapshot state. Creature snapshots use health_percent; local-player snapshots may only have the IDA-confirmed TPlayerData.health value.
Returns
| Type | Summary |
|---|---|
boolean|nil | dead nil when neither health source is available. |
onMap
method · onMap(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
position
method · position(self: Player): Position?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
Position? | — |
kind
method · kind(self: Player): 'self'|'player'|'monster'|'npc'|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
'self'|'player'|'monster'|'npc'|nil | — |
isSelf
method · isSelf(self: Player): boolean
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean | — |
isPlayer
method · isPlayer(self: Player): boolean
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean | — |
isMonster
method · isMonster(self: Player): boolean
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean | — |
isNpc
method · isNpc(self: Player): boolean
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean | — |
creatureType
method · creatureType(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
isSummon
method · isSummon(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isOwnSummon
method · isOwnSummon(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
summonerId
method · summonerId(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
skull
method · skull(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
isSkull
method · isSkull(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
party
method · party(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
isPartyLeader
method · isPartyLeader(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isPartyMember
method · isPartyMember(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isOnScreen
method · isOnScreen(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
state
method · state(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
hasState
method · hasState(self: Player, bit: integer): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Parameters
| Name | Type | Summary |
|---|---|---|
bit | integer | — |
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isPoisoned
method · isPoisoned(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isBurning
method · isBurning(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isElectrified
method · isElectrified(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isDrunk
method · isDrunk(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isParalyzed
method · isParalyzed(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isHasted
method · isHasted(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isInFight
method · isInFight(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isDrowning
method · isDrowning(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isFreezing
method · isFreezing(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isDazzled
method · isDazzled(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isCursed
method · isCursed(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isBleeding
method · isBleeding(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isRooted
method · isRooted(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isFeared
method · isFeared(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
hasPartyBuff
method · hasPartyBuff(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
isInProtectionZone
method · isInProtectionZone(self: Player): boolean|nil
Returns boolean|nil: in_zone nil means live state and mapped tile are both unavailable
Returns
| Type | Summary |
|---|---|
boolean|nil | in_zone nil means live state and mapped tile are both unavailable |
isInPz
method · isInPz(self: Player): boolean|nil
Familiar compatibility spelling used by other Tibia bot APIs.
Returns
| Type | Summary |
|---|---|
boolean|nil | in_zone |
isPzLocked
method · isPzLocked(self: Player): boolean|nil
PvP entry lock, not current PZ occupancy.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
hasManaShield
method · hasManaShield(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |
direction
method · direction(self: Player): integer?
Inclusive range 0..7 when known.
Returns
| Type | Summary |
|---|---|
integer? | — |
targetId
method · targetId(self: Player): integer?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
integer? | — |
tactics
method · tactics(self: Player): PlayerTactics?
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
PlayerTactics? | — |
isFullAttackMode
method · isFullAttackMode(self: Player): boolean|nil
A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.
Returns
| Type | Summary |
|---|---|
boolean|nil | — |