Core Interfaces
IEncounterable
Base interface for all encounter types.PKHeX.Core/Legality/Encounters/Templates/Interfaces/IEncounterable.cs
IEncounterTemplate
Represents all details that an entity may be encountered with.PKHeX.Core/Legality/Encounters/Templates/Interfaces/IEncounterTemplate.cs
IEncounterMatch
Defines matching logic for encounter validation.Encounter Types
EncounterStatic
Represents static encounters (gifts, legendaries, scripted events). Generation 8 Example:- Fixed encounter location and level
- Optional fixed IVs, nature, gender, ability
- Weather conditions for Gen 8 Wild Area
- Dynamax/Gigantamax support
- Overworld correlation validation
PKHeX.Core/Legality/Encounters/Templates/Gen8/EncounterStatic8.cs
EncounterSlot
Represents wild encounters in specific areas. Generation 8 Example:- Level range (min/max)
- Parent area reference
- Weather-dependent spawns
- Special encounter methods (fishing, curry)
- Symbol vs. hidden encounters
PKHeX.Core/Legality/Encounters/Templates/Gen8/EncounterSlot8.cs
EncounterTrade
Represents in-game NPC trades. Generation 8 Example:- Fixed trainer ID and OT name
- Optional fixed nickname
- Fixed or random nature/gender/ability
- Original trainer memories (Gen 6+)
- Cannot be shiny (typically)
PKHeX.Core/Legality/Encounters/Templates/Gen8/EncounterTrade8.cs
Other Encounter Types
| Type | Description | Key Classes |
|---|---|---|
| EncounterEgg | Bred eggs | EncounterEgg8, EncounterEgg9 |
| EncounterSlot7GO | Pokémon GO transfers | EncounterSlot7GO, EncounterSlot8GO |
| EncounterShadow | Shadow Pokémon (Colosseum/XD) | EncounterShadow3Colo, EncounterShadow3XD |
| EncounterTera | Tera Raid battles (Gen 9) | EncounterTera9, EncounterMight9 |
| EncounterStatic8a | Legends: Arceus encounters | EncounterStatic8a, EncounterSlot8a |
| EncounterGift | Gift Pokémon | EncounterGift1, EncounterGift3 |
Encounter Matching
EncounterMatchRating
Indicates match quality between PKM and encounter template.Match Validation
Encounters implementIsMatchExact to validate:
- Met location and level
- Form compatibility
- Gender (if fixed)
- IVs (if fixed/flawless)
- Ability number
- Ball type
- Overworld correlation (Gen 8+)
Encounter Generation
IEncounterConvertible
Encounters can generate valid PKM objects.Encounter Data Sources
Encounter data is organized by generation:Key Enums
Shiny
AbilityPermission
Related Documentation
- Verifiers - Validation logic for encounters
- Evolutions - Evolution chain validation
- Moves - Move legality checking