Skip to content

Custom Showdown Datapacking

YajatKaul edited this page Jan 18, 2026 · 19 revisions

Important

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

Abilities

To add custom Pokémon abilities in the game

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
}

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

HeldItems

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

{
	name: "Adrenaline Orb",
	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",
}

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

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 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