Skip to main content

Overview

The Pokemon class represents a single Pokemon in battle. It tracks HP, status, stats, moves, abilities, items, and all other Pokemon state during a battle.
// Pokemon instances are created by the Battle engine
const pokemon = battle.p1.pokemon[0];

Key Properties

Identity

name
string
The Pokemon’s nickname or species name
species
Species
The Pokemon’s species data
baseSpecies
Species
The base species (before forme changes)
level
number
The Pokemon’s level (1-100)
gender
'M' | 'F' | 'N'
The Pokemon’s gender
shiny
boolean
Whether the Pokemon is shiny

Battle State

hp
number
Current HP (0 to maxhp)
maxhp
number
Maximum HP
fainted
boolean
Whether the Pokemon has fainted
status
'par' | 'slp' | 'frz' | 'brn' | 'psn' | 'tox' | ''
Primary status condition
statusState
StatusState
Status-specific state (e.g., sleep turns, toxic counter)

Combat Properties

moveSlots
MoveSlot[]
Array of the Pokemon’s moves with PP
ability
string
Current ability ID
baseAbility
string
Original ability before changes
item
string
Current held item ID
itemState
any
Item-specific state data

Stats

stats
StatsTable
Current stat values
boosts
BoostsTable
Stat stage boosts (-6 to +6) for

Position

side
Side
The side this Pokemon belongs to
position
number
Position on the field (0 for singles, 0-2 for triples)
isActive
boolean
Whether the Pokemon is currently on the field

Core Methods

getHealth()

Get the Pokemon’s health in battle protocol format.
pokemon.getHealth(); // Returns "48/100" or "0 fnt"
return
string
Health string in format “hp/maxhp” or “0 fnt”

getDetails()

Get the Pokemon’s details for battle protocol.
pokemon.getDetails(); // Returns "Pikachu, L50, M"
return
string
Details string with species, level, gender, shiny

clearVolatile()

Remove all volatile status conditions.
pokemon.clearVolatile();

cureStatus()

Cure the Pokemon’s primary status.
pokemon.cureStatus(); // Cure paralysis, burn, etc.

setStatus()

Inflict a status condition.
pokemon.setStatus('par'); // Paralyze
pokemon.setStatus('slp', null, null, 3); // Sleep for 3 turns
status
string
required
Status ID (‘par’, ‘slp’, ‘frz’, ‘brn’, ‘psn’, ‘tox’)
source
Pokemon | null
Source Pokemon
effect
Effect | null
Causing effect

getTypes()

Get the Pokemon’s current types.
const types = pokemon.getTypes(); // ['Electric']
return
string[]
Array of type names

addVolatile()

Add a volatile status condition.
pokemon.addVolatile('confusion');
pokemon.addVolatile('substitute');
status
string
required
Volatile status ID

hasType()

Check if the Pokemon has a specific type.
if (pokemon.hasType('Water')) {
  // Water-type Pokemon
}

hasAbility()

Check if the Pokemon has a specific ability.
if (pokemon.hasAbility('Levitate')) {
  // Immune to Ground
}

hasItem()

Check if the Pokemon has a specific item.
if (pokemon.hasItem('Leftovers')) {
  // Holding Leftovers
}

useItem()

Consume the held item.
pokemon.useItem(); // Remove consumed item

setItem()

Set the held item.
pokemon.setItem('Leftovers');

takeItem()

Remove and return the held item.
const item = pokemon.takeItem();

setAbility()

Change the Pokemon’s ability.
pokemon.setAbility('Moxie');

formeChange()

Change the Pokemon’s forme.
pokemon.formeChange('Giratina-Origin');

getMoveData()

Get data for a specific move.
const moveData = pokemon.getMoveData('thunderbolt');

deductPP()

Deduct PP from a move.
pokemon.deductPP('thunderbolt', 1);

Stat Methods

getStat()

Get a modified stat value.
const speed = pokemon.getStat('spe'); // Modified by boosts, status, etc.
stat
StatID
required
Stat name: ‘atk’, ‘def’, ‘spa’, ‘spd’, ‘spe’
unboosted
boolean
Ignore stat boosts
unmodified
boolean
Ignore all modifiers

getWeight()

Get the Pokemon’s current weight in kg.
const weight = pokemon.getWeight();

getMoveHitData()

Get data about how a move would hit this Pokemon.
const data = pokemon.getMoveHitData(move);

Example Usage

// Access Pokemon in battle
const pokemon = battle.p1.active[0];

// Check state
if (pokemon.hp > 0 && !pokemon.fainted) {
  console.log(`${pokemon.name} has ${pokemon.hp}/${pokemon.maxhp} HP`);
}

// Check types
if (pokemon.hasType('Water')) {
  console.log('Water-type Pokemon');
}

// Check ability
if (pokemon.hasAbility('Intimidate')) {
  console.log('Has Intimidate');
}

// Get stats
const speed = pokemon.getStat('spe');
console.log(`Speed: ${speed}`);

// Check moves
for (const moveSlot of pokemon.moveSlots) {
  console.log(`${moveSlot.name}: ${moveSlot.pp}/${moveSlot.maxpp} PP`);
}

// Modify Pokemon
pokemon.setStatus('par'); // Paralyze
pokemon.addVolatile('confusion'); // Confuse
pokemon.boosts.atk = 1; // +1 Attack

Battle

Battle class

Side

Side class

Species Data

Species API

Moves Data

Moves API

Build docs developers (and LLMs) love