Tooltip Selectors
Tooltip Selectors
Section titled “Tooltip Selectors”Bazaar tooltip configs under config/bazaar/tooltips/ can pull data from several different roots. Choosing the right one matters:
| Root | Use it for | Notes |
|---|---|---|
pokemonDisplay.* | Stable normalized Pokemon tooltip fields | Best first choice for most Pokemon tooltip work |
pokemonJson.* | Saved JSON-derived Cobblemon fields | Good fallback when pokemonDisplay does not expose the field |
pokemon.* | Live runtime and NBT-backed access | Advanced only; only works when a live Pokemon exists in the tooltip context |
formatted.* | Preformatted Bazaar display values | Price, expiry, current bid, buyout, etc. |
listing.* | Raw Bazaar listing model fields | Seller, channel, listing type, ids, timestamps |
attributes.* | Flattened Bazaar attribute map | Species/form/moves/item-derived metadata |
Hyper-Trained Fields on pokemonDisplay
Section titled “Hyper-Trained Fields on pokemonDisplay”Wondering which root to use for hyper-trained data? Prefer pokemonDisplay.*.
Available selectors:
pokemonDisplay.hyperTrainedpokemonDisplay.hyperTrainedFlags.hppokemonDisplay.hyperTrainedFlags.atkpokemonDisplay.hyperTrainedFlags.defpokemonDisplay.hyperTrainedFlags.spapokemonDisplay.hyperTrainedFlags.spdpokemonDisplay.hyperTrainedFlags.spepokemonDisplay.hyperTrainedFlags.anypokemonDisplay.hyperTrainedCountpokemonDisplay.hyperTrainedSummary
What they mean:
pokemonDisplay.hyperTrainedis the aggregate set. In selector text contexts it stringifies as a comma-joined list of stat labels.pokemonDisplay.hyperTrainedFlags.*are the ergonomic per-stat booleans.pokemonDisplay.hyperTrainedFlags.anyis a simple “does this Pokemon have any hyper-trained stat?” boolean.pokemonDisplay.hyperTrainedCountis the count of hyper-trained stats.pokemonDisplay.hyperTrainedSummaryis the comma-joined label summary.
Copy-paste examples:
{ type = "selector", selector = "pokemonDisplay.hyperTrainedSummary", value = "<gray>Hyper Trained:</gray> <white>{value}</white>", hide-if-empty = true }{ type = "text", value = "<gray>Hyper Trained Count:</gray> <white>{bazaar:selector:pokemonDisplay.hyperTrainedCount}</white>", show-if-molang = "q.tooltip.bool('pokemonDisplay.hyperTrainedFlags.any') == 1" }{ type = "text", value = "<green>HP is Hyper Trained</green>", show-if-molang = "q.tooltip.bool('pokemonDisplay.hyperTrainedFlags.hp') == 1" }Live Pokemon Selector Access
Section titled “Live Pokemon Selector Access”In relevant tooltip contexts, Bazaar also injects a live restored pokemon object.
Practical examples:
pokemon.levelpokemon.tradeablepokemon.persistentData.dexlivespokemon.persistentData.some_nested_tag
Important nuance:
- This only works where a live Pokemon exists in the tooltip context.
- Prefer
pokemonDisplay.*first for stable/common fields. - Prefer
pokemonJson.*next when you need saved JSON-derived fields. - Use
pokemon.*for advanced runtime or NBT-backed access.
In current Bazaar runtime paths, live pokemon is available in:
- Pokemon sell/source picker preview tooltips
- Pokemon listing tooltips resolved for a real player
It is not part of the default item tooltip contexts.
Copy-paste examples:
{ type = "text", value = "<gray>Level:</gray> <white>{bazaar:selector:pokemon.level}</white>" }{ type = "selector", selector = "pokemon.persistentData.dexlives", value = "<gray>Dex Lives:</gray> <white>{value}</white>", hide-if-empty = true }NBT Selector Support
Section titled “NBT Selector Support”Bazaar’s selector resolver traverses Minecraft NBT directly. It supports:
CompoundTag- NBT collections/lists
- numeric tags
- string tags
That means paths like this work directly:
pokemon.persistentData.dexlives
And list-style traversal also works by numeric index when the underlying value is an NBT collection.
This support applies both to normal selectors and to the q.tooltip.* Molang bridge helpers described below.
Tooltip Molang Bridge
Section titled “Tooltip Molang Bridge”Bazaar tooltip Molang exposes:
q.tooltip.str('path')q.tooltip.num('path')q.tooltip.bool('path')q.pokemon
What they do:
q.tooltip.str('path')resolves any tooltip selector path as a stringq.tooltip.num('path')resolves any tooltip selector path as a numberq.tooltip.bool('path')resolves any tooltip selector path as a booleanq.pokemonexposes Cobblemon’s livePokemon#struct
Important nuance:
q.pokemonis only available when a live Pokemon exists in the tooltip context.q.pokemoncomes from Cobblemon’s native Molang-facing struct, not from Bazaar’s normalizedpokemonDisplay.
Copy-paste examples:
{ type = "text", value = "<gray>Dex Lives:</gray> <white>{bazaar:molang:q.tooltip.num('pokemon.persistentData.dexlives')}</white>" }{ type = "text", value = "<green>Hyper Trained HP</green>", show-if-molang = "q.tooltip.bool('pokemonDisplay.hyperTrainedFlags.hp') == 1" }{ type = "text", value = "<gray>Level: <white>{bazaar:molang:q.pokemon.level}</white>" }Context Guidance
Section titled “Context Guidance”Use this order in practice:
formatted.*when Bazaar already gives you a display-ready valuepokemonDisplay.*for normalized Pokemon tooltip fieldspokemonJson.*for saved JSON-derived fallback accessattributes.*for flattened market metadatalisting.*for raw Bazaar listing statepokemon.*only when you need live runtime or NBT-backed access
Examples by root:
{ type = "text", value = "<gray>Price:</gray> <green>{bazaar:selector:formatted.price}</green>" }{ type = "text", value = "<gray>Species:</gray> <white>{bazaar:selector:pokemonDisplay.species}</white>" }{ type = "selector", selector = "pokemonJson.PokemonOriginalTrainerName", value = "<gray>OT:</gray> <white>{value}</white>", hide-if-empty = true }{ type = "selector", selector = "attributes.ability", value = "<gray>Ability Key:</gray> <white>{value}</white>", hide-if-empty = true }{ type = "text", value = "<gray>Listing Type:</gray> <white>{bazaar:selector:listing.listingType}</white>" }Where to Look in the Bundled Tooltip Files
Section titled “Where to Look in the Bundled Tooltip Files”The strongest source examples today live in:
pokemon-preview.confpokemon-compact.confpokemon-full.conf
pokemon-preview.conf contains the shared DSL and selector rules. pokemon-full.conf is the richest live-Pokemon detail context. If you want to add advanced runtime-backed lines, start there.