Overview
ThePokemon class represents a single Pokemon in battle. It tracks HP, status, stats, moves, abilities, items, and all other Pokemon state during a battle.
Key Properties
Identity
The Pokemon’s nickname or species name
The Pokemon’s species data
The base species (before forme changes)
The Pokemon’s level (1-100)
The Pokemon’s gender
Whether the Pokemon is shiny
Battle State
Current HP (0 to maxhp)
Maximum HP
Whether the Pokemon has fainted
Primary status condition
Status-specific state (e.g., sleep turns, toxic counter)
Combat Properties
Array of the Pokemon’s moves with PP
Current ability ID
Original ability before changes
Current held item ID
Item-specific state data
Stats
Current stat values
Stat stage boosts (-6 to +6) for
Position
The side this Pokemon belongs to
Position on the field (0 for singles, 0-2 for triples)
Whether the Pokemon is currently on the field
Core Methods
getHealth()
Get the Pokemon’s health in battle protocol format.Health string in format “hp/maxhp” or “0 fnt”
getDetails()
Get the Pokemon’s details for battle protocol.Details string with species, level, gender, shiny
clearVolatile()
Remove all volatile status conditions.cureStatus()
Cure the Pokemon’s primary status.setStatus()
Inflict a status condition.Status ID (‘par’, ‘slp’, ‘frz’, ‘brn’, ‘psn’, ‘tox’)
Source Pokemon
Causing effect
getTypes()
Get the Pokemon’s current types.Array of type names
addVolatile()
Add a volatile status condition.Volatile status ID
hasType()
Check if the Pokemon has a specific type.hasAbility()
Check if the Pokemon has a specific ability.hasItem()
Check if the Pokemon has a specific item.useItem()
Consume the held item.setItem()
Set the held item.takeItem()
Remove and return the held item.setAbility()
Change the Pokemon’s ability.formeChange()
Change the Pokemon’s forme.getMoveData()
Get data for a specific move.deductPP()
Deduct PP from a move.Stat Methods
getStat()
Get a modified stat value.Stat name: ‘atk’, ‘def’, ‘spa’, ‘spd’, ‘spe’
Ignore stat boosts
Ignore all modifiers
getWeight()
Get the Pokemon’s current weight in kg.getMoveHitData()
Get data about how a move would hit this Pokemon.Example Usage
Related APIs
Battle
Battle class
Side
Side class
Species Data
Species API
Moves Data
Moves API
