Skip to content

Custom Showdown Datapacking

YajatKaul edited this page Jan 20, 2026 · 19 revisions

Important

  • Make sure to not add comments into your files, it doesn't evaluate well, you could try using comments like /* */ but in anycase if u face any issues it could be due to comments.

Abilities

data/namespace/mega_showdown/showdown/abilities/ability_name.js

{
    onSwitchIn(pokemon) {
      this.effectState.switchingIn = true;
    },
    onStart(pokemon) {
      if (this.effectState.switchingIn) {
        this.add("-ability", pokemon, "Air Lock");
        this.effectState.switchingIn = false;
      }
      this.eachEvent("WeatherChange", this.effect);
    },
    onEnd(pokemon) {
      this.eachEvent("WeatherChange", this.effect);
    },
    suppressWeather: true,
    flags: {},
    name: "Ability Name",
    rating: 1.5,
    num: 76
}

Highlights

  • Name: The typing matters so Ability Name != ability name

This wiki wont exactly teach you how to make abilities and showdown logic, you can refer other existing abilities to craft your custom one from Showdown

Conditions

data/namespace/mega_showdown/showdown/conditions/condition_name.js

{
	name: 'condition_name',
	effectType: 'Status',
	onStart(target, source, sourceEffect) {
		if (sourceEffect && sourceEffect.effectType === 'Ability') {
			this.add('-status', target, 'psn', '[from] ability: ' + sourceEffect.name, '[of] ' + source);
		} else {
			this.add('-status', target, 'psn');
		}
	},
	onResidualOrder: 9,
	onResidual(pokemon) {
		this.damage(pokemon.baseMaxhp / 8);
	},
}

This wiki wont exactly teach you how to make conditions and showdown logic, you can refer other existing abilities to craft your custom one from Showdown This wiki wont exactly teach you how to make conditions and showdown logic, you can refer other existing abilities to craft your custom one from Showdown If you want to make persistent conditions which stay after battle like freeze you can refer Custom Persistent Statuses

Held Items

data/namespace/mega_showdown/showdown/held_items/held_item_name.js

{
	name: "Held Item Name",
	spritenum: 660,
	fling: {
		basePower: 30,
	},
	onAfterBoost(boost, target, source, effect) {
		if (target.boosts['spe'] === 6 || boost.atk === 0) {
			return;
		}
		if (effect.name === 'Intimidate') {
			target.useItem();
		}
	},
	boosts: {
		spe: 1,
	},
	num: 846,
	gen: 7,
}

This wiki wont exactly teach you how to make held items and showdown logic, you can refer other existing abilities to craft your custom one from Showdown

Moves

data/namespace/mega_showdown/showdown/moves/move_name.js

{
	num: 512,
	accuracy: 100,
	basePower: 55,
	basePowerCallback(pokemon, target, move) {
		if (!pokemon.item) {
			this.debug("BP doubled for no item");
			return move.basePower * 2;
		}
		return move.basePower;
	},
	category: "Physical",
	name: "Move Name",
	pp: 15,
	priority: 0,
	flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1},
	secondary: null,
	target: "any",
	type: "Flying",
	contestType: "Cool",
}

Highlights -

  • Name: The typing matters so Move Name != move name
  • Type: Field should follow the naming scheme so Flying != flying
  • Target: Field tells if the move is spread, any or all

This wiki wont exactly teach you how to make moves and showdown logic, you can refer other existing abilities to craft your custom one from Showdown

Scripts

data/namespace/mega_showdown/showdown/scripts/actions.js

{
  canMegaEvo(pokemon) {
    const species = pokemon.species;
    const item = pokemon.getItem();

    if (species.baseSpecies === "Rayquaza") {
      if (pokemon.terastallized || item.zMove) return null;
      if (pokemon.baseMoves.includes("dragonascent")) return "Rayquaza-Mega";
    }

    const megaKey = species.otherFormes?.find((form) => /.*-Mega(-[a-zA-Z])?/.test(form));
    const megaForme = megaKey && this.dex.species.get(megaKey);
    if (
      (this.battle.gen <= 7 || this.battle.ruleTable.has("+pokemontag:past")) &&
      megaForme?.requiredMove &&
      pokemon.baseMoves.includes(this.dex.toID(megaForme.requiredMove)) &&
      !item.zMove
    ) {
      return megaForme.name;
    }

    if (species.name.startsWith("Tauros")) {
      if (
        item.megaEvolves?.some(evo => evo.startsWith("Tauros")) &&
        item.megaStone !== species.name
      ) {
        return item.megaStone;
      }
      return null;
    }

    if (
      item.megaEvolves?.includes(species.name) &&
      item.megaStone !== species.name
    ) {
      return item.megaStone;
    }

    return null;
  }
}

The file note denotes the thing its changing so here actions.js meaning battle-actions and here its changing how the canMegaEvo function should behave. Sadly I can't find much examples for this so yea tinker with it ig.

TypeCharts

data/namespace/mega_showdown/showdown/typecharts/type_id.js

{
	damageTaken: {
		Bug: 0,
		Dark: 0,
		Dragon: 0,
		Electric: 0,
		Fairy: 0,
		Fighting: 2,
		Fire: 1,
		Flying: 1,
		Ghost: 0,
		Grass: 2,
		Ground: 2,
		Ice: 0,
		Normal: 0,
		Poison: 0,
		Psychic: 0,
		Rock: 1,
		Steel: 0,
		Stellar: 0,
		Water: 0,
	},
	HPivs: {atk: 30, def: 30, spd: 30},
	HPdvs: {atk: 13, def: 13},
}

This is basically how much damage taken, resisted is against other types To create a new type refer Custom Types

This wiki wont exactly teach you how to make moves and showdown logic, you can refer other existing abilities to craft your custom one from Showdown

Clone this wiki locally