Essentials Docs Wiki
For how an encounter method is defined and used, see Adding new encounter methods.
For wild Pokémon that are encountered in fixed locations, see Event encounters.
For specific Pokémon that roam between maps, see Roaming Pokémon.
For encountering Pokémon while fishing, see Fishing encounters.
For wild encounters caused by Rock Smash or Headbutt, see Obstacles.

This page describes wild Pokémon encounters. This includes how to set up random encounters (e.g. long grass, caves), and how to modify encounters based on various factors (e.g. location).

Setting wild encounters for a map

The PBS file "encounters.txt" lists all the wild Pokémon encounters for each map. Each map has its own section, which begins with that map's ID number and optionaly a version number. The section is laid out in the following order:

Order Information Description
1 Map ID number The map's ID number. This can be found in the middle of RPG Maker XP's status bar (at the bottom) while the map is open for editing.
Version Number The version number, optional the default is 0.

Encounter method An encounter method. Possible encounter methods are:
  • Land - For long grass. Pokémon will appear only while moving in the grass.
  • LandDay - Same as "Land", but for encounters between 5am and 8pm. If not defined, the "Land" encounter method is used instead.
  • LandNight - Same as "Land", but for encounters between 8pm and 5am. If not defined, the "Land" encounter method is used instead.
  • LandMorning - Same as "Land", but for encounters between 5am and 10am. If not defined, the "LandDay" encounter method is used instead.
  • BugContest - Same as "Land", but for when the player is in a Bug Catching Contest. If not defined, the "Land" encounter method is used instead.
  • Cave - For caves and other maps where wild encounters can occur anywhere, not just on particular tiles. An encounter may occur after each step taken.
  • Water - For surfing. An encounter may occur after each step taken.
  • RockSmash - For when the player smashes a breakable rock.
  • OldRod - For when the player uses the Old Rod.
  • GoodRod - For when the player uses the Good Rod.
  • SuperRod - For when the player uses the Super Rod.
  • HeadbuttLow - For when Headbutt is used on a tree. These Pokémon are rare to find in a Headbutt encounter.
  • HeadbuttHigh - For when Headbutt is used on a tree. These Pokémon are common to find in a Headbutt encounter.
Encounter density The likelihood of an encounter for this encounter method. This is optional, A higher number means a greater chance of an encounter with each step. Without modifications, the chance of a wild encounter happening per step taken is the appropriate encounter density divided by 180
3 List of Pokémon This is a list of the Pokémon encounterable via the encounter method stated above. Each line in the list contains two or four comma-separated elements:
  1. An encounter chance.
  2. A Pokémon species.
  3. A level.
  4. A second level. Optional. Must be higher than the first level.

If the second level is defined, the two numbers define a range of levels (inclusive) that the species can be found at. Each level in that range has an equal chance of being chosen.

A given map can have multiple encounter methods and corresponding lists of Pokémon. However, a map's section cannot have more than one of the same encounter method.

The "Cave" encounter method cannot be defined if one of "Land", "LandDay", "LandNight", "LandMorning" or "BugContest" is also defined. However, all three encounter density values are defined for all values, even though the first and second values (for tall grass and cave respectively) are mutually exclusive.

Encounter method Pokémon lists

The probability of choosing a particular entry is that entry's probability divided by the sum of all probabilities for that encounter method. By default, the sum of probabilities for each encounter method is 100, meaning that an entry's probability also happens to be a percentage, but they don't have to sum to 100.


[005,1] # Route 1

This example sets the encounters for map number 5 version 1. The probability of an encounter in Land and LandNight are 21/180 per step.

There is two encounter methods (Land and LandNight).For this example we will focus on Land, that has the listed Pokémon (Sentret, Pidgey and Rattata) that can be encountered at the given levels. The chances of encountering a particular species are as follows:

  • Pidgey (Lv. 14-18) - 45%
  • Rattata (Lv. 13-18) - 45%
  • Sentret (Lv. 13-17) - 20%

Sentret has an equal chance of being at each of the levels in their given ranges, but Rattata and Pidgey do not. Because each of the entries in which Rattata and Pidgey are placed have their own encounter probabilities, the chance of encountering a Rattata and Pidgey at a given level also depends on these entry probabilities. In this case, higher levels of Rattata and Pidgey are more likely to be encountered, because lower levels are in the entries with lower probability.

For a more complete example:

[069] # Route 8

This example shows how a map can be defined with multiple encounter methods. The encounter methods here are "Land", "Water", "OldRod", "GoodRod" and "SuperRod" (highlighted).

Double wild battles

Main article: Partner trainer

All wild Pokémon battles will be single battles, unless the player has a partner trainer or if the encounter is on the terrain tag tall grass (10), in which case double battles have a 30% chance of occurring.

In a double wild battle, Poké Balls cannot be used if both wild Pokémon are active. They can only be used if exactly 1 wild Pokémon is active (i.e. the other has fainted).

Alternate Encounter Tables

v19 added the ability to set alternate encounter tables for a map. Alternate encounter tables are defined in encounters.txt in the same way as regular tables, but they begin with [Map ID,version number] rather than just [Map ID].

The variable $PokemonGlobal.encounter_version determines which version of the encounter table will be used for a map. (must be a number, default is 0) If a map doesn't have an encounter version that matches the variable, it will use the default table instead.

Modifying wild Pokémon

It is possible to modify many attributes of a wild Pokémon (e.g. make it shiny, choose its gender, change its stats, moveset, etc.). See Editing a Pokémon for information on which attributes can be changed. The method described below is the best way of editing a wild Pokémon.

Firstly, decide on one or more conditions under which a Pokémon should have its attribute(s) altered. In this example, the condition is Game Switch 42 being ON, but it could instead be the map, the weather, the terrain tag of the tile you're standing on, the number of Gym Badges the player has, or even an attribute of the Pokémon being encountered (such as its species or gender). There are many more possible conditions. Make sure your conditions apply only when you want them to.

Secondly, look in the script section PField_EncounterModifiers. In there are a couple of examples of the code below. You may choose to add your own copies of this code into this script section, or into a new script section to keep better track of your edits.

The basic code is as follows:

Events.onWildPokemonCreate += proc{|sender,e|
  pkmn = e[0]
  if $game_switches[42]

This example will cause all wild Pokémon to know the move Hidden Power, as long as Game Switch 42 is ON when the encounter occurs.