Tutorials/Creating Custom Spawns
Preface
This tutorial will show you how to create your own custom Pokémon spawns. The JSONs in the spawn pool world folder control how a Pokémon will spawn naturally. You can create or edit files for each Pokémon to give them new spawn conditions. Writing some extra data in the pack.mcmeta
of a datapack can also nullify the spawns from the base mod. You can use this to have total control over Pokémon spawns.
Some third party tools exist to help with the mass production of spawn files. Help with mass spawn file production can be found on the Cobblemon Discord server.
Step 1: Arrange the folders for this addon
Depending on the kind of addon you want to make, you may want to make some slight adjustments to your folder structure of your spawn files. Generally, you can arrange your custom spawn files the same way other addons do. Your spawn files can have their own namespace
if you don't want them to be affected by other mods.
Create a pack.mcmeta to suit your needs
Your pack.mcmeta
can affect how your addon will work with other addons loaded before yours. A normal pack.mcmeta will have no affect on other addons, but adding some extra lines of data to it can completely nullify files in a specified folder.
Use one of the following pack.mcmeta
examples below. Unless you have plans to negate all other spawns, like making your own custom region for something, then just make an addon friendly pack.mcmeta
file!
- The addon friendly pack.mcmeta - This one wont affect other addon files
- Create a new text file and name it
pack.mcmeta
- Ensure that it doesn't end in other file extensions like .txt
- Open the file and insert the following data:
- Create a new text file and name it
{ "pack": { "pack_format": 15, "description": "Example datapack description" } }
- Save the file and prepare to place it in your addon folders.
- The pack.mcmeta that negates all other spawns - Will prevent spawns in the base mod or addons loaded before it from working.
- Create a new text file and name it
pack.mcmeta
- Ensure that it doesn't end in other file extensions like .txt
- Open the file and insert the following data:
- Create a new text file and name it
{ "pack": { "pack_format": 15, "description": "Example datapack description" }, "filter": { "block": [ { "namespace": "cobblemon", "path": "spawn_pool_world" } ] } }
- Save the file and prepare to place it in your addon folders.
Now, you can create the folders to place your files into.
Folder Structure
Now you can create the folder structure for your addon. Create a series of folders arranged like the following example. Don't forget to place your pack.mcmeta
that you just made. You can create your own namespace instead of using the cobblemon namespace if you don't want your spawn files to be affected from folder blocking.
Folder Structure
- (addon name)
- pack.mcmeta
- data
- cobblemon
- spawn_pool_world
- <sub_folders> (optional)
- spawn_pool_world
- cobblemon
All of the spawn files
will be placed somewhere in the spawn pool world folder!
Step 2: Create your spawn files
There's a lot of data that can go into a spawn file
. The data in spawn files can be rather self-explanatory. These files can be as simple as "spawn in the forest", or as complicated as "spawn at 2:30AM-3:00AM on top of clay during the new moon in an ocean biome that is south of spawn." The possibilities are limited by your creativity and understanding of spawn conditions
Keep in mind that the sort of "economy" of local spawns will affect the rarity of the Pokémon you are making spawn files for. For example, if you made spawn conditions for a Kyogre to spawn on the ocean surface in the ultra-rare pool with a really low weight, it will actually spawn more frequently than you intended despite the low weight. This is because there aren't many ultra-rare water surface spawns to begin with. If this example Kyogre is the only ultra-rare spawn in this local ultra-rare pool, then whenever the game decides to spawn an ultra-rare Pokémon, it will be Kyogre 100% of the time. Kyogre would have no other ultra-rare spawn to compete with so it will always be the chosen spawn.
Here is a list of options that some of the spawn properties can use:
- "presets": You can use any of these presets listed on the Gitlab or you can make your own presets.
- "context": You can choose between
"grounded"
for land spawns,"submerged"
for underwater spawns, and"surface"
for spawns on the surface of water or lava. - "bucket": The rarity pool of the Pokémon. You can choose
"common"
,"uncommon"
,"rare"
, or"ultra-rare"
- "weight": This determines how common the Pokémon will be inside of the assigned rarity pool. Generally, you can treat it like a scale of 0.1 to 10 on how rare it will be in that pool. You can use numbers higher than 10 if you really want that Pokémon to spawn more often.
- "condition": You can use any of the conditions listed here to make Pokémon spawn
- "anticondition": You can use any of the conditions listed here to PREVENT a Pokémon from spawning
- "biomes": A subcategory of conditions and anticonditions. You can use biome ids or any biome tags. Should work with modded biome id's too!
To keep things simple, this part of the guide will show you how to create a spawn file from a template.
- Obtain a JSON to use as a template from the Gitlab.
- Buneary is a great example template. The file is short, but Buneary is very common due to having 3 biome groups it can spawn in.
- Rename the file to anything you want. The name must be different than the original.
- Example:
bunearyspawn2
- If the file name and folder path are exactly the same as the base mod, then it will replace the base mod's spawn file instead. This is only recommended if you want to tune existing spawn files to your liking.
- Example:
- Open the file and locate all the strings for
"id"
and"pokemon"
- Edit the Pokémon's name and replace it with the Pokémon you want to make custom spawns for.
- If you stop after this step, then the replacement Pokémon will now spawn in the exact same conditions as the previous Pokémon.
- Replace the list of
"presets"
if desired- A list of available presets can be found on the Gitlab
- Replace the value for
"context"
if desired. - Replace the value for
"bucket"
if desired. - Change the values for
"level"
. This is the minimum and maximum level it will spawn at. - Replace the value for
"weight"
if desired.- Treat the number like a scale of 0.1 to 10 for its rarity bucket. This will keep your spawns balanced with other spawn files.
- Change the
"condition"
values if desired.- Most of the time, you'll want to change the list of
"biomes"
- Most of the time, you'll want to change the list of
- Change the
"anticondition"
values if desired.- Sometimes you might even want to delete this section if it exists in the template.
- Save the file.
- Place this new spawn file in the
spawn_pool_world
folder of your addon - Repeat the whole process for any other spawn files you want to make!
Step 3: Test your addon in game
Load your addon in game to see if your custom spawn files are working. You can have your preferred file editor open to edit any relevant JSON files in the datapacks folder if needed.
- Copy your addon folder and place it in the "datapacks" folder of your world in the Minecraft root directory.
- Start up Minecraft.
- Load/create a Creative world save that contains your addon in the "datapack" folder.
- Check if your target Pokémon spawns where you assigned it to. You can use
/checkspawn <rarity>
when in the assigned biome.- You can run the command
/locate biome <assigned biome>
to get coordinates to the assigned biome. You can then click on the coordinates it gave you and be teleported instantly. - You can also use the command
/locate structure <assigned structure>
if you used a structure condition.
- You can run the command
- Ensure that your target Pokémon at least appears in the
checkspawn
list after meeting its conditions.- If your Pokémon appears in this checkspawn list, then it will spawn in the area eventually! It's always a matter of time and RNG.
- Make any desired edits to the data files and save. You need to quit to main menu, and load the world again if you want to see those changes.
- The command for
/reload
does not work with Cobblemon addons unfortunately.
- The command for
You should now have new natural Pokémon spawns!