Line 86: Line 86:
<br>
<br>
====='''Gender'''=====
====='''Gender'''=====
Gender is managed via the `maleRatio` property. This property should have a decimal value between 0 and 1, and is the percent chance for a Pokémon to spawn as a male. A value of `0.1` for example would lead to a 10% chance to spawn as a male. The special value of `-1` is reserved for genderless Pokémon.
Gender is managed via the <code>maleRatio</code> property.  
* This property should have a decimal value between 0 and 1, and is the percent chance for a Pokémon to spawn as a male.  
** A value of <code>0.1</code> for example would lead to a 10% chance to spawn as a male.  
* The special value of <code>-1</code> is reserved for genderless Pokémon.


==== Species File Breakdown ====
==== Species File Breakdown ====

Revision as of 03:23, 23 February 2024

Preface

The species JSON contains all the data of each Pokémon and its various forms. The species file is everything a Pokémon is without the visual aspects. Moves, abilities, forms, size, evolutions, and so much more are contained in this single file for every Pokémon. Cobblemon already includes most of this data for all 1,017 Pokémon.

Creating a custom Pokémon is as simple as creating a new species file! You can borrow an existing Pokémon's species file and swap the name for a new one or you can create a new file from scratch. It is highly recommended that you use Cobblemon's Fakemon Generator to create new species files.

The Species File

The species file contains large amounts of data about Pokémon that connect to all the other systems that make Pokémon function in game. Some properties in the file are self explanatory, while others are not so clear. This section will provide lots of helpful information and links to help you understand all the different systems that connect to the species file.

Helpful Information

Some very helpful links and resources will be listed below. They can help you with understanding the mechanics of both the mod and Pokémon in general.

Where to get species files
  • The Cobblemon Gitlab - This is where Cobblemon's source code is hosted. You can find the species files of all Pokémon in that link. They should be in folders sorted by generation.


Where to find official Pokémon data
  • Bulbagarden - This website has information about Pokémon both from the games and the anime. You can find many references about each Pokémon here.
  • Pokémon Database - This website has all kinds of information about Pokémon, but is more focused on stats. A lot of that data is the same or similar to what's written in the species files.
  • Serebii - This website probably has the most information about Pokémon. Serebii provides accurate data and media references with images of these media appearances.


Behaviors and AI information
  • Behavior Wiki Page - This wiki page will list and explain all the different behavior properties you can write for a Pokémon. This assigns the Pokémon its AI behavior. You can also copy a similar Pokémon's behavior code block if you are unsure how to create one.


Forms, Features, and Aspects
  • Regional Forms - This links to a tutorial about setting up regional forms. Regional forms usually have different stats and this tutorial can show you how to set them up.
  • Multiple Visual Forms - This links to a tutorial about creating multiple visual forms like the different Torterra trees. These kinds of forms usually keep the same stats as the normal form and this tutorial can show you how to set them up.
  • Species Features - This is the wiki page about species features. Features are what create "Aspects." Aspects are what allows for all the different visual forms for Pokémon.


Evolutions
  • The Cobblemon Gitlab - It is recommended that you use an existing Pokémon's evolution data as a template for evolutions. All existing evolution methods should be written into their respective pokemon's species file.
  • Cobblemon's Fakemon Generator - You can also generate evolution methods using the Fakemon generator. It will give you all the evolution methods when creating new species files.
  • Evolution Requirements From the Cobblemon Gitlab - This links to a folder on the gitlab that has the code files to all the possible evolution requirements for you to reference. All of these methods are used by at least one official Pokémon. It is recommended that you look up this Pokémon's species file to replicate its evolution method.


Shoulder Effects

Cobblemon's shoulder effects are custom coded versions of the minecraft potion effects. So you can't use any potion effect as a shoulder effect. If it's not from cobblemon, the species file will fail to load.

Version 1.4 removed the shoulder effects so they could be rebalanced at a later date.

Version 1.3 shoulder effects:

  • haste
  • water_breathing
  • speed
  • slow_falling


Moves and Learning Methods

This section of the species file determines the moves a Pokémon can learn. There are 4 methods of learning moves. Only 1 of them is currently implemented and that's level learning.

Every move from the official games should be in Cobblemon. In order for moves to be read properly, they must be written in the correct format for the move list. The method type goes on the left side of a colon and the move name goes on the right side of the colon. Moves that contain 2 or more words must be bunched together into one "word" and can't contain any spaces, underscores, commas, or hyphens. Everything must remain in lowercase as well.

Example of each method and name format:

  • "5:quickattack" : Level - This would let a Pokémon learn quick attack at level 5. The number determines what level the move will be learned at.
  • "egg:thunder" : Egg Move - This would let a Pokémon inherit thunder from one of its parents. It will hatch from its egg knowing this move when breeding gets implemented.
  • "tm:thunderbolt" : TMs - This would allow a Pokémon to use a thunderbolt TM when TMs get implemented.
  • "tutor:10000000voltthunderbolt" : Tutor - This would allow a Pokémon to learn 10,000,000 Volt Thunderbolt from a tutor when tutors get implemented.


Item Drops

Cobblemon drops work differently than vanilla drops. You need to set a target amount of drops, then it tries to achieve this drop amount by rolling for drops in the entries listed. If an entry passes a percentage check, then it will count as 1 towards the targeted amount. Once this target amount is achieved, it will stop trying to roll for drops even if it did not finish reading all the entries. If it runs out of entries and did not achieve this target, then it will also stop rolling for drops. Once it stops rolling, all of the drops that passed the percentage check will drop where the Pokémon was defeated.

Example code block for drops:

  • Since amount is set to 1 and there is only 1 entry, then it will only roll for drops from this 1 entry.
  • The sweet berries entry does not list a percentage value, so by default its 100%.
  • This would make Vulpix drop 2-3 berries 100% of the time
"drops": {
  "amount": "1",
  "entries": [
    {
      "item": "minecraft:sweet_berries",
      "quantityRange": "2-3"
    }
  ]
},


Hitbox and Base Scale

The size of the Pokémon model and its hitbox are controlled by the species file. If you want to change any of these values and see the results, you must load the singleplayer world from the main menu. The /reload command does not work with Cobblemon datapacks. Loading the world again is the proper way to refresh Cobblemon datapacks.

  • baseScale will size the Pokémon up or down. A value of 1 will let the model be at a one to one scale with its size in blockbench.
  • hitbox has 3 values you can change, but you will only want to change the height and width of the hitbox. In game, you can press F3+B to show the hitboxes on entities.
  • A hitbox width of 1 will let the hitbox be as wide as 1 minecraft block. Width is akin to radius.


Height and Weight

The height and weight that will be used for the Pokédex when it gets implemented. The unit for height is in decimeters. The unit for weight is in hectograms. Dividing these values by 10 will give you the metric units for meters and kilograms.

  • height doesn't do anything significant and is misleading a lot of the time in the Pokédex. Sometimes it measures distance from the ground, and sometimes it measures how long a Pokémon is.
  • weight will determine the damage value of weight based moves like heavy slam. Make sure you set these weights to hectograms or these moves may do unintentional amounts of damage.


Gender

Gender is managed via the maleRatio property.

  • This property should have a decimal value between 0 and 1, and is the percent chance for a Pokémon to spawn as a male.
    • A value of 0.1 for example would lead to a 10% chance to spawn as a male.
  • The special value of -1 is reserved for genderless Pokémon.

Species File Breakdown

As far as the writer of this article is concerned, Vulpix has one of the most fleshed out species files. This makes Vulpix a great example to explain the different sections of the species file. You can reference some of the resources listed above and compare them with the written data below. Hover over the underlined text to see more information.

{
 "implemented": true,
 "name": "Vulpix",
 "nationalPokedexNumber": 37,
 "primaryType": "fire",
 "abilities": [
   "flashfire",
   "h:drought"
 ],
 "baseStats": {
   "hp": 38,
   "attack": 41,
   "defence": 40,
   "special_attack": 50,
   "special_defence": 65,
   "speed": 65
 },
 "behaviour": {
   "resting": {
     "canSleep": true,
     "willSleepOnBed": true,
     "depth": "normal",
     "light": "0-4"
   }
 },
 "catchRate": 190,
 "maleRatio": 0.25,
 "shoulderMountable": false,
 "forms": [
   {
     "name": "Alola",
     "primaryType": "ice",
     "abilities": [
       "snowcloak",
       "h:snowwarning"
     ],
     "baseStats": {
       "hp": 38,
       "attack": 41,
       "defence": 40,
       "special_attack": 50,
       "special_defence": 65,
       "speed": 65
     },
     "catchRate": 190,
     "maleRatio": 0.25,
     "baseExperienceYield": 60,
     "baseFriendship": 50,
     "evYield": {
       "hp": 0,
       "attack": 0,
       "defence": 0,
       "special_attack": 0,
       "special_defence": 0,
       "speed": 1
     },
     "experienceGroup": "medium_fast",
     "eggCycles": 20,
     "eggGroups": [
       "field"
     ],
     "moves": [
       "1:powdersnow",
       "1:tailwhip",
       "4:disable",
       "7:roar",
       "8:iceshard",
       "9:babydolleyes",
       "12:spite",
       "16:icywind",
       "18:payback",
       "20:confuseray",
       "23:feintattack",
       "24:aurorabeam",
       "26:hex",
       "28:extrasensory",
       "32:icebeam",
       "34:safeguard",
       "36:imprison",
       "40:mist",
       "44:auroraveil",
       "47:captivate",
       "48:sheercold",
       "52:grudge",
       "56:blizzard",
       "egg:agility",
       "egg:babydolleyes",
       "egg:charm",
       "egg:disable",
       "egg:encore",
       "egg:extrasensory",
       "egg:flail",
       "egg:freezedry",
       "egg:howl",
       "egg:hypnosis",
       "egg:moonblast",
       "egg:powerswap",
       "egg:roar",
       "egg:secretpower",
       "egg:spite",
       "egg:tailslap",
       "tm:agility",
       "tm:attract",
       "tm:auroraveil",
       "tm:blizzard",
       "tm:bodyslam",
       "tm:charm",
       "tm:confide",
       "tm:darkpulse",
       "tm:dig",
       "tm:doubleteam",
       "tm:drainingkiss",
       "tm:encore",
       "tm:endure",
       "tm:facade",
       "tm:foulplay",
       "tm:frostbreath",
       "tm:frustration",
       "tm:hail",
       "tm:hex",
       "tm:hiddenpower",
       "tm:icebeam",
       "tm:icywind",
       "tm:imprison",
       "tm:irontail",
       "tm:payback",
       "tm:powerswap",
       "tm:protect",
       "tm:psychup",
       "tm:raindance",
       "tm:rest",
       "tm:return",
       "tm:roar",
       "tm:round",
       "tm:safeguard",
       "tm:sleeptalk",
       "tm:snore",
       "tm:substitute",
       "tm:swagger",
       "tm:swift",
       "tm:tailslap",
       "tm:toxic",
       "tm:weatherball",
       "tm:zenheadbutt",
       "tutor:aquatail",
       "tutor:aurorabeam",
       "tutor:babydolleyes",
       "tutor:blizzard",
       "tutor:celebrate",
       "tutor:confuseray",
       "tutor:covet",
       "tutor:darkpulse",
       "tutor:dazzlinggleam",
       "tutor:dig",
       "tutor:facade",
       "tutor:foulplay",
       "tutor:headbutt",
       "tutor:healbell",
       "tutor:icebeam",
       "tutor:iceshard",
       "tutor:icywind",
       "tutor:irontail",
       "tutor:mist",
       "tutor:painsplit",
       "tutor:powdersnow",
       "tutor:protect",
       "tutor:reflect",
       "tutor:rest",
       "tutor:roar",
       "tutor:roleplay",
       "tutor:snore",
       "tutor:spite",
       "tutor:substitute",
       "tutor:tackle",
       "tutor:tailwhip",
       "tutor:toxic",
       "tutor:zenheadbutt"
     ],
     "labels": [
       "gen7",
       "alola_regional"
     ],
     "aspects": [
       "alolan"
     ],
     "height": 6,
     "weight": 99,
     "evolutions": [
       {
         "id": "vulpix_ninetales",
         "variant": "item_interact",
         "result": "ninetales form=alola",
         "consumeHeldItem": false,
         "learnableMoves": [
           "dazzlinggleam"
         ],
         "requirements": [],
         "requiredContext": "cobblemon:ice_stone"
       }
     ],
     "cannotDynamax": false,
     "battleOnly": false
   }
 ],
 "features": [
   "alolan"
 ],
 "baseExperienceYield": 60,
 "experienceGroup": "medium_fast",
 "eggCycles": 20,
 "eggGroups": [
   "field"
 ],
 "drops": {
   "amount": "1",
   "entries": [
     {
       "item": "minecraft:sweet_berries",
       "quantityRange": "2-3"
     }
   ]
 },
 "moves": [
   "1:ember",
   "1:tailwhip",
   "4:disable",
   "7:roar",
   "8:quickattack",
   "9:babydolleyes",
   "12:spite",
   "16:incinerate",
   "18:payback",
   "20:confuseray",
   "23:feintattack",
   "24:willowisp",
   "26:hex",
   "28:extrasensory",
   "28:flameburst",
   "32:flamethrower",
   "36:imprison",
   "40:firespin",
   "44:safeguard",
   "47:captivate",
   "48:inferno",
   "52:grudge",
   "56:fireblast",
   "egg:babydolleyes",
   "egg:captivate",
   "egg:disable",
   "egg:energyball",
   "egg:extrasensory",
   "egg:feintattack",
   "egg:flail",
   "egg:flamecharge",
   "egg:flareblitz",
   "egg:heatwave",
   "egg:hex",
   "egg:howl",
   "egg:hypnosis",
   "egg:memento",
   "egg:powerswap",
   "egg:psychup",
   "egg:roar",
   "egg:secretpower",
   "egg:spite",
   "egg:tailslap",
   "tm:agility",
   "tm:attract",
   "tm:bodyslam",
   "tm:captivate",
   "tm:confide",
   "tm:darkpulse",
   "tm:dig",
   "tm:doubleteam",
   "tm:encore",
   "tm:endure",
   "tm:energyball",
   "tm:facade",
   "tm:fireblast",
   "tm:firespin",
   "tm:flamecharge",
   "tm:flamethrower",
   "tm:flareblitz",
   "tm:foulplay",
   "tm:frustration",
   "tm:heatwave",
   "tm:hex",
   "tm:hiddenpower",
   "tm:imprison",
   "tm:incinerate",
   "tm:irontail",
   "tm:mysticalfire",
   "tm:naturalgift",
   "tm:overheat",
   "tm:payback",
   "tm:powerswap",
   "tm:protect",
   "tm:psychup",
   "tm:rest",
   "tm:return",
   "tm:roar",
   "tm:round",
   "tm:safeguard",
   "tm:secretpower",
   "tm:sleeptalk",
   "tm:snore",
   "tm:substitute",
   "tm:sunnyday",
   "tm:swagger",
   "tm:swift",
   "tm:tailslap",
   "tm:toxic",
   "tm:weatherball",
   "tm:willowisp",
   "tm:zenheadbutt",
   "tutor:attract",
   "tutor:bide",
   "tutor:bodyslam",
   "tutor:burningjealousy",
   "tutor:charm",
   "tutor:confuseray",
   "tutor:covet",
   "tutor:curse",
   "tutor:darkpulse",
   "tutor:dig",
   "tutor:disable",
   "tutor:doubleedge",
   "tutor:doubleteam",
   "tutor:ember",
   "tutor:endure",
   "tutor:facade",
   "tutor:feintattack",
   "tutor:fireblast",
   "tutor:firespin",
   "tutor:flail",
   "tutor:flamethrower",
   "tutor:foulplay",
   "tutor:frustration",
   "tutor:headbutt",
   "tutor:heatwave",
   "tutor:hiddenpower",
   "tutor:hypnosis",
   "tutor:irontail",
   "tutor:mimic",
   "tutor:ominouswind",
   "tutor:painsplit",
   "tutor:protect",
   "tutor:quickattack",
   "tutor:rage",
   "tutor:reflect",
   "tutor:rest",
   "tutor:return",
   "tutor:roar",
   "tutor:roleplay",
   "tutor:safeguard",
   "tutor:skullbash",
   "tutor:sleeptalk",
   "tutor:snore",
   "tutor:spite",
   "tutor:substitute",
   "tutor:sunnyday",
   "tutor:swagger",
   "tutor:swift",
   "tutor:tackle",
   "tutor:tailwhip",
   "tutor:takedown",
   "tutor:toxic",
   "tutor:willowisp",
   "tutor:zenheadbutt"
 ],
 "labels": [
   "gen1",
   "kanto_regional"
 ],
 "pokedex": [
   "cobblemon.species.vulpix.desc"
 ],
 "evolutions": [
   {
     "id": "vulpix_ninetales",
     "variant": "item_interact",
     "result": "ninetales",
     "consumeHeldItem": false,
     "learnableMoves": [],
     "requirements": [],
     "requiredContext": "cobblemon:fire_stone"
   }
 ],
 "baseScale": 0.7,
 "hitbox": {
   "width": 0.9,
   "height": 1.1,
   "fixed": false
 },
 "baseFriendship": 50,
 "evYield": {
   "hp": 0,
   "attack": 0,
   "defence": 0,
   "special_attack": 0,
   "special_defence": 0,
   "speed": 1
 },
 "height": 6,
 "weight": 99,
 "aspects": [],
 "cannotDynamax": false
}