Bulk Operations
The bulk editing system provides powerful string-based instruction parsing for batch modifying PKM entities. This system is used extensively in PKHeX for batch editing multiple Pokémon at once.EntityBatchEditor
The main class for bulk editing PKM entities using string instructions. Namespace:PKHeX.Core
Overview
EntityBatchEditor processes string-based instructions to modify PKM data in bulk. It supports:- Property modifications with various operators
- Filtering based on property values
- Special values like
$rand,$shiny, and$suggest - Complex modifications for ribbons, EVs, and more
Properties
Instance
Methods
ScreenStrings
IsFilterMatchMeta
Custom Properties
The batch editor supports several custom properties beyond standard PKM properties:General Properties
Legal- Filters based on legality status$TypeName- Filters by PKM type name (e.g., “PK8”, “PA8”)
PersonalInfo Properties
PersonalType1- Primary type from PersonalInfoPersonalType2- Secondary type from PersonalInfoHasType- Checks if either type matches
SlotCache Properties
IdentifierContains- Filters by identifier stringSlot- Slot number (1-indexed)Box- Box number (1-indexed)
Bulk Properties
Ribbons- Bulk ribbon operationsEVs- Bulk EV operationsContestStats- Bulk contest stat operationsMoveMastery- Move mastery flags (Legends: Arceus)PlusMoves- Plus move flags (Legends: Z-A)
Special Values
$rand
Applies a random value within valid range.$shiny
Makes the Pokémon shiny.$suggest
Applies suggested legal values.$[]
Defines byte array values.StringInstruction
Represents a batch editing instruction. Namespace:PKHeX.Core
Constructor
Properties
PropertyName- Property to modifyPropertyValue- Value to set or compare againstComparer- Comparison type for filtersOperation- Operation type for modificationsRandom- Whether to apply a random value
Static Methods
GetFilters
GetInstructions
Instruction Syntax
Filters (Comparisons)
Filters start with a comparison operator:Modifications (Operations)
Modifications start with an operation operator:Random Ranges
Specify random ranges with commas:BatchInfo
Wrapper containing PKM entity and legality analysis for batch editing. Namespace:PKHeX.Core
Constructor
Properties
Entity- PKM entity to be modifiedLegality- Legality analysis (eagerly evaluated)Legal- Boolean indicating if the entity is legal
ModifyResult
Batch editor modification result for an individual operation. Namespace:PKHeX.Core
Enumeration
InstructionComparer
Comparison types for batch editing filters. Namespace:PKHeX.Core
InstructionOperation
Operation types for batch editing modifications. Namespace:PKHeX.Core
Usage Examples
Basic Filtering and Modification
Using Special Values
Complex Filtering
Bulk Modifications
BatchFilters
Provides complex filters for batch editing. Namespace:PKHeX.Core
Properties
FilterMods
Legal- Legality status$TypeName- PKM type namePersonalType1- Primary typePersonalType2- Secondary typeHasType- Either type matches
FilterMeta
IdentifierContains- Identifier contains textBox- Box numberSlot- Slot number
BatchMods
Provides complex modifications for batch editing. Namespace:PKHeX.Core
Properties
SuggestionMods
Stat_CP- Reset CP (Pokémon GO)HeightAbsolute/WeightAbsolute- Reset sizeBall- Suggest legal ball by colorMoves- Suggest legal movesetRelearnMoves- Suggest relearn movesMetLocation- Suggest met locationRibbons- Apply valid ribbonsEVs- Suggest EVsContestStats- Suggest contest statsMoveMastery- Suggest mastery flagsPlusMoves- Suggest plus flags
ComplexMods
- Date parsing (YYYYMMDD format)
- Ability realignment
- Random values (PID, Gender, EVs, TeraType)
- Shiny values
- Encryption constant