Skip to content

Datapacks ​

Everything about a set lives in JSON, so sets, cards and reward rules can be added or changed with a datapack. Run /reload to apply changes.

WhatWherePage
A set: name, size, wrappers, pack slotsdata/<namespace>/tcg/sets/<set>.jsonSet files
A card: name, type, HP, rarity, Pokédex numberdata/<namespace>/tcg/cards/<set>/<number>.jsonCard files
When packs are handed outdata/<namespace>/tcg/rewards/*.jsonReward rules

The set id comes from the file path: data/foo/tcg/sets/bar.json is the set foo:bar, and its cards go in data/foo/tcg/cards/bar/.

Adding a new set ​

A set needs a datapack and a resource pack:

  1. Datapack: a set file and one card file per card.
  2. Resource pack: the textures of every card and wrapper, plus their item models and custom_model_data overrides. Without those the cards show the card back.
  3. Shop: add the set id to shop.sets to have Card Dealers sell it at their next level.
  4. Rewards: add reward rules if catching Pokémon should give its packs.

The mod's own sets are built this way. In the repository, tools/gen_cards.py writes the card files, the models and the overrides from a card list (tools/<set>.csv), and tools/gen_card_art.py draws the textures:

FileContent
tools/<set>.csvThe card list: number,name,supertype,type,hp,rarity
tools/<set>_text.jsonThe game text drawn on the cards: stage, evolves from, level, Pokémon Powers, attacks, weakness, resistance, retreat, trainer and energy rules
bash
pip install pillow numpy          # Python 3.10+, Pillow 10.1+
python tools/gen_cards.py         # card JSONs, models and overrides for every CSV
python tools/gen_card_art.py      # frames, holo foil, card art, packs, card back (about 3 minutes)
python tools/gen_card_art.py --skip-existing-art --set base2 --only 4,58

--skip-existing-art keeps card art you have already replaced, and --set and --only redraw one set or some card numbers.

Changing the odds of a set ​

Override the set file at the same path, data/cobblemontcg/tcg/sets/base1.json, with your own pack_slots. For only the holo rate or the pack size, the config is enough.

Released under the CC0-1.0 License. Unofficial fan project, not affiliated with Nintendo, The Pokémon Company, Game Freak or Creatures Inc.