Overview
TheShowdownSet class provides functionality for importing and exporting Pokémon data in the Pokémon Showdown text format. This is useful for sharing Pokémon sets, importing competitive teams, and converting between PKHeX and Showdown formats.
Namespace: PKHeX.Core
Inheritance: Object → ShowdownSet
Implements: IBattleTemplate
Constructors
Creates a new ShowdownSet from Showdown format text.Parameters:
input(ReadOnlySpan<char>): Showdown format text (can be multi-line)localization(BattleTemplateLocalization?): Language localization settings (default: English)
Creates a new ShowdownSet from an enumerable of lines.Parameters:
lines(IEnumerable<string>): Lines of Showdown format textlocalization(BattleTemplateLocalization?): Language localization settings (default: English)
Creates a new ShowdownSet from a PKM object.Parameters:
pk(PKM): Pokémon to convert to Showdown formatlocalization(BattleTemplateLocalization?): Language localization settings (default: English)
Properties
Basic Information
Gets the species ID.
Gets the form index.
Gets the form name as text.
Gets the nickname.
Gets the gender (0 = Male, 1 = Female, 2 = Genderless, null = unspecified).
Battle Properties
Gets the level (default: 100).
Gets whether the Pokémon is shiny.
Gets the held item ID.
Gets the ability ID.
Gets the nature.
Gets the friendship value (default: 255).
Stats
Gets the Effort Values array (HP, ATK, DEF, SPE, SPA, SPD).Default: [0, 0, 0, 0, 0, 0]
Gets the Individual Values array (HP, ATK, DEF, SPE, SPA, SPD).Default: [31, 31, 31, 31, 31, 31]
Moves
Gets the move IDs array (up to 4 moves).
Gets the Hidden Power type (if applicable, -1 if not specified).
Generation-Specific
Gets the generation/game context.
Gets whether the Pokémon can Gigantamax (Gen 8).
Gets the Dynamax level (Gen 8, default: 10).
Gets the Tera Type (Gen 9).
Validation
Gets the list of lines that failed to parse.Remarks: Check this after parsing to see if there were any issues.
Methods
Export Methods
Gets the Showdown format text representation.Parameters:
language(string): Language code (default: “en”)
Gets the Showdown format text in the specified language.Parameters:
language(LanguageID): Language ID
Gets the Showdown format text with custom export settings.Parameters:
settings(BattleTemplateExportSettings): Export configuration
Gets all lines of the Showdown format as a list.Parameters:
language(string): Language code (default: “en”)
Gets all lines with custom export settings.Parameters:
settings(BattleTemplateExportSettings): Export configuration
Populates a list with Showdown format lines.Parameters:
result(List<string>): List to populatesettings(BattleTemplateExportSettings): Export configuration
Utility Methods
Forces properties to indicate the set for preview display.Parameters:
pk(PKM): Pokémon to preview
Static Methods
Gets the string representation of stats.Type Parameters:
T: Stat value type
stats(ReadOnlySpan<T>): Stats arrayignoreValue(T): Value to ignore (e.g., 0 for EVs, 31 for IVs)statNames(StatDisplayConfig): Stat display configuration
GetStringStatsNatureAmp<T>(ReadOnlySpan<T> stats, T ignoreValue, StatDisplayConfig statNames, Nature nature)
static method
Gets stats string with nature amplification indicators.Type Parameters:
T: Stat value type
stats(ReadOnlySpan<T>): Stats arrayignoreValue(T): Value to ignorestatNames(StatDisplayConfig): Stat display configurationnature(Nature): Nature for +/- indicators
Usage Examples
Importing from Showdown Format
Converting PKM to Showdown Format
Creating a Set Programmatically
Converting Set to PKM
Batch Import from Text File
Export with Custom Settings
Working with Generation-Specific Features
Hidden Power Type Handling
Validating Parsed Sets
Showdown Format Specification
The Showdown format follows this structure:See Also
- PKM Class - For working with Pokémon data
- SaveFile Class - For working with save files
- LegalityAnalysis Class - For validating Pokémon legality