The DexItems API provides comprehensive data about Pokemon items including held items, berries, Z-Crystals, Mega Stones, and their battle effects. Access it through Dex.items.
import { Dex } from './sim/dex';// Get an item by nameconst lifeOrb = Dex.items.get('Life Orb');console.log(lifeOrb.name); // 'Life Orb'console.log(lifeOrb.fling?.basePower); // 30// Get all itemsconst allItems = Dex.items.all();console.log(allItems.length); // 1600+ (in Gen 9)
Indicates if item is nonstandard: 'Past', 'Future', 'LGPE', etc. null for standard items.
Example:
const assaultVest = Dex.items.get('Assault Vest');console.log(assaultVest.name); // 'Assault Vest'console.log(assaultVest.num); // 640console.log(assaultVest.gen); // 6console.log(assaultVest.shortDesc); // 'SpD is 1.5x, but only damaging moves can be selected.'
interface FlingData { basePower: number; // Base power when flung status?: string; // Status condition inflicted volatileStatus?: string; // Volatile status inflicted}
// Stat-boosting itemsconst choiceBand = Dex.items.get('Choice Band');console.log(choiceBand.shortDesc); // 'Atk is 1.5x, but only one move can be selected.'const assaultVest = Dex.items.get('Assault Vest');console.log(assaultVest.shortDesc); // 'SpD is 1.5x, but only damaging moves can be selected.'// Recovery itemsconst leftovers = Dex.items.get('Leftovers');console.log(leftovers.shortDesc); // 'Restores 1/16 max HP at the end of every turn.'const blackSludge = Dex.items.get('Black Sludge');console.log(blackSludge.shortDesc); // 'Restores 1/16 max HP for Poison types; damages others.'
// Status-healing berriesconst lumBerry = Dex.items.get('Lum Berry');console.log(lumBerry.isBerry); // trueconsole.log(lumBerry.shortDesc); // 'Cures any status condition.'// Pinch berriesconst sitrusBerry = Dex.items.get('Sitrus Berry');console.log(sitrusBerry.shortDesc); // 'Restores 1/4 max HP when at 1/2 max HP or less.'// Type-resist berriesconst occaBerry = Dex.items.get('Occa Berry');console.log(occaBerry.shortDesc); // 'Halves Fire damage taken. Single use.'
// Focus Sashconst focusSash = Dex.items.get('Focus Sash');console.log(focusSash.shortDesc); // 'Holder survives any attack with at least 1 HP if at full HP. Single use.'// Rocky Helmetconst rockyHelmet = Dex.items.get('Rocky Helmet');console.log(rockyHelmet.shortDesc); // 'If holder is hit by contact move, attacker loses 1/6 max HP.'// Life Orbconst lifeOrb = Dex.items.get('Life Orb');console.log(lifeOrb.shortDesc); // 'Holder\'s attacks do 1.3x damage, and it loses 1/10 its max HP after the attack.'
// Items were introduced in Gen 2const gen1Dex = Dex.mod('gen1');const gen1Items = gen1Dex.items.all();console.log(gen1Items.length); // Very few or none// Gen 3 introduced held items more extensivelyconst gen3Dex = Dex.mod('gen3');const gen3Leftovers = gen3Dex.items.get('Leftovers');console.log(gen3Leftovers.gen); // 2// Mega Stones in Gen 6const gen6Dex = Dex.mod('gen6');const gen6MegaStones = gen6Dex.items.all().filter(i => i.megaStone);console.log(`Gen 6 has ${gen6MegaStones.length} Mega Stones`);// Z-Crystals in Gen 7const gen7Dex = Dex.mod('gen7');const gen7ZCrystals = gen7Dex.items.all().filter(i => i.zMove);console.log(`Gen 7 has ${gen7ZCrystals.length} Z-Crystals`);// Some items become nonstandard in later gensconst gen8ZCrystal = Dex.mod('gen8').items.get('Firium Z');console.log(gen8ZCrystal.isNonstandard); // 'Past'