The pokémon object

class poke_env.battle.pokemon.Pokemon(gen: int, *, species: str | None = None, name: str | None = None, request_pokemon: Dict[str, Any] | None = None, details: str | None = None, teambuilder: TeambuilderPokemon | None = None)

Bases: object

property ability: str | None
Returns:

The pokemon’s ability. None if unknown or removed.

Return type:

str, optional

property active: bool | None
Returns:

Boolean indicating whether the pokemon is active.

Return type:

bool

available_moves_from_request(request: Dict[str, Any]) List[Move]
property available_z_moves: List[Move]

Caution: this property is not properly tested yet.

Returns:

The set of moves that pokemon can use as z-moves.

Return type:

List[Move]

property base_ability: str | None
Returns:

The pokemon’s base ability. None if unknown.

Return type:

str, optional

property base_moves: Dict[str, Move]
Returns:

The pokemon’s underlying move dictionary. When transformed, this returns the temporary move set; otherwise it returns the learned moves.

Return type:

Dict[str, Move]

property base_species: str
Returns:

The pokemon’s base species.

Return type:

str

property base_stats: Dict[str, int]
Returns:

The pokemon’s base stats.

Return type:

Dict[str, int]

property base_types: List[PokemonType]
Returns:

The pokemon’s non-Tera types, accounting for temporary type changes. Unlike types, this ignores Terastallization.

Return type:

List[PokemonType]

boost(stat: str, amount: int)
property boosts: Dict[str, int]
Returns:

The pokemon’s boosts.

Return type:

Dict[str, int]

cant_move()
check_consistency(pkmn_request: Dict[str, Any], player_role: str)
check_move_consistency(active_request: Dict[str, Any], is_doubles: bool = False)
clear_active()
clear_boosts()
clear_negative_boosts()
clear_positive_boosts()
copy_boosts(mon: Pokemon)
cure_status(status: str | None = None)
property current_hp: int
Returns:

The pokemon’s current hp. For your pokemons, this is the actual value. For opponent’s pokemon, this value depends on showdown information: it can be on a scale from 0 to 100 or on a pixel scale.

Return type:

int

property current_hp_fraction: float
Returns:

The pokemon’s current remaining hp fraction.

Return type:

float

damage(hp_status: str)
damage_multiplier(type_or_move: PokemonType | Move) float

Returns the damage multiplier associated with a given type or move on this pokemon.

This method is a shortcut for PokemonType.damage_multiplier with relevant types.

Parameters:

type_or_move (PokemonType or Move) – The type or move of interest.

Returns:

The damage multiplier associated with given type on the pokemon.

Return type:

float

property effects: Dict[Effect, int]
Returns:

A Dict mapping the effects currently affecting the pokemon and the associated counter.

Return type:

Dict[Effect, int]

end_effect(effect_str: str)
end_item(item: str)
end_turn()
property evs: list[int] | None
Returns:

The pokemon’s EVs as a list of [HP, Atk, Def, SpA, SpD, Spe]. None if unknown (e.g. opponent’s pokemon).

Return type:

List[int] | None

faint()
property fainted: bool
Returns:

Whether the pokemon has fainted.

Return type:

bool

property first_turn: bool
Returns:

Whether this is this pokemon’s first action since its last switch in.

Return type:

bool

forme_change(species: str)
property forme_change_ability: str | None
Returns:

The pokemon’s ability after changing forme. None if the pokemon hasn’t changed forme.

Return type:

str, optional

property gen: int
Returns:

The generation of the pokemon.

Return type:

int

property gender: PokemonGender | None
Returns:

The pokemon’s gender.

Return type:

PokemonGender, optional

property height: float
Returns:

The pokemon’s height, in meters.

Return type:

float

property hp_status: str
identifier(player_role: str) str

” :param player_role: The player’s role in the battle (p1 or p2) :type player_role: str :return: The pokemon’s identifier, which can be used to identify it in Showdown logs

identifies_as(ident: str) bool
invert_boosts()
property is_dynamaxed: bool
Returns:

Whether the pokemon is currently dynamaxed

Return type:

bool

property is_terastallized: bool
Returns:

Whether the pokemon is currently terastallized

Return type:

bool

property item: str | None
Returns:

The pokemon’s item.

Return type:

str | None

property ivs: list[int] | None
Returns:

The pokemon’s IVs as a list of [HP, Atk, Def, SpA, SpD, Spe]. None if unknown (e.g. opponent’s pokemon).

Return type:

List[int] | None

property last_move: Move | None
Returns:

The last move used by this pokemon, or None.

Return type:

Move | None

property level: int
Returns:

The pokemon’s level.

Return type:

int

property max_hp: int
Returns:

The pokemon’s max hp. For your pokemons, this is the actual value. For opponent’s pokemon, this value depends on showdown information: it can be on a scale from 0 to 100 or on a pixel scale.

Return type:

int

mega_evolve(stone: str)
property mimic_move: Move | None
Returns:

The move currently copied by Mimic, if any.

Return type:

Move | None

moved(move_id: str, failed: bool = False, use: bool = True, reveal: bool = True, pressure: bool = False)
property moves: Dict[str, Move]
Returns:

A dictionary of the pokemon’s known moves.

Return type:

Dict[str, Move]

property must_recharge: bool
Returns:

A boolean indicating whether the pokemon must recharge.

Return type:

bool

property name: str
Returns:

The pokemon’s name, which can be used to create Showdown’s identifier.

Return type:

str

property nature: str | None
Returns:

The pokemon’s nature if known. None if not provided by the teambuilder.

Return type:

str | None

property pokeball: str | None
Returns:

The pokeball in which is the pokemon.

Return type:

str | None

property possible_abilities: List[str]
Returns:

The list of possible abilities for this pokemon.

Return type:

List[str]

prepare(move_id: str, target: Pokemon | None)
property preparing: bool
Returns:

Whether this pokemon is preparing a multi-turn move.

Return type:

bool

property preparing_move: Move | None
Returns:

The move being prepared - optional.

Return type:

Move, optional

property preparing_target: bool | Pokemon | None
Returns:

The moves target - optional.

Return type:

Any

primal()
property protect_counter: int
Returns:

How many protect-like moves where used in a row by this pokemon.

Return type:

int

property revealed: bool
Returns:

Whether this pokemon has appeared in the current battle.

Return type:

bool

property selected_in_teampreview: bool
Returns:

Whether this pokemon was selected in teampreview.

Return type:

bool

set_boost(stat: str, amount: int)
set_hp(hp_status: str)
set_hp_status(hp_status: str, store=False)
property shiny: bool
Returns:

Whether this pokemon is shiny.

Return type:

bool

property species: str
Returns:

The pokemon’s species.

Return type:

str | None

property stab_multiplier: float
Returns:

The pokemon’s STAB multiplier.

Return type:

float

start_effect(effect_str: str, details: Any | None = None)
property stats: Dict[str, int | None]
Returns:

The pokemon’s stats, as a dictionary.

Return type:

Dict[str, int | None]

property status: Status | None
Returns:

The pokemon’s status.

Return type:

Optional[Status]

property status_counter: int
Returns:

The pokemon’s status turn count. Only counts TOXIC and SLEEP statuses.

Return type:

int

switch_in(details: str | None = None)
switch_out(fields: Dict[Field, int])
property temporary_ability: str | None
Returns:

The pokemon’s temporary ability, None if none is set.

Return type:

Optional[str]

property tera_type: PokemonType | None
Returns:

The Tera Type of the Pokemon, None if unnown

Return type:

Optional[PokemonType]

terastallize(type_: str)
transform(into: Pokemon)
property transformed: bool
Returns:

Whether the pokemon is currently transformed.

Return type:

bool

property type_1: PokemonType
Returns:

The pokemon’s first type.

Return type:

PokemonType

property type_2: PokemonType | None
Returns:

The pokemon’s second type.

Return type:

Optional[PokemonType]

property types: List[PokemonType]
Returns:

The pokemon’s types. Not a Tuple because moves can add types and also remove types, and override them too.

Return type:

Tuple[PokemonType]

update_from_request(request_pokemon: Dict[str, Any])
was_illusioned(fields: Dict[Field, int])
property weight: float
Returns:

The pokemon’s weight, in kilograms.

Return type:

float