Bring Cobblemon data, events, storage queries, administrative utilities, and client-side Pokedex displays into KubeJS.
Cobblemon KubeJS Bridge lets modpack developers build custom progression, quests, rewards, commands, interfaces, battle systems, and server mechanics using JavaScript.
Listen to server-side events such as:
CobblemonEvents.pokemonCaptured(event => {
event.player.tell(
`You caught ${event.species} at level ${event.level}!`
)
})
Query a player's Pokedex progress:
var caughtFire = CobblemonJS.pokedex.countCaughtByType(
player,
'fire'
)
Both short and namespaced IDs are supported:
CobblemonJS.species.exists('charizard')
CobblemonJS.species.exists('cobblemon:charizard')
Read safe Pokemon snapshots from a player's party and PC:
var party = CobblemonJS.pokemon.getParty(player)
var pokemon = CobblemonJS.pokemon.getByUuid(player, pokemonUuid)
Trusted server scripts can:
CobblemonJS.admin.givePokemon(
player,
'charizard level=50 shiny=true'
)
CobblemonJS.admin.spawnPokemon(
player.serverLevel,
'rayquaza level=70',
100,
80,
-50
)
The server synchronizes a read-only Pokedex cache to the owning client. Client scripts can use it for live tooltips and other interfaces without requesting data from the server every frame.
CobblemonClientJS.pokedex.countSeen()
CobblemonClientJS.pokedex.countCaught()
CobblemonClientJS.pokedex.countCaughtByType('fire')
The included examples contain a tested dynamic spyglass tooltip.
Install the bridge on both the client and server when using the synchronized client Pokedex API.
NeoForge is currently supported.
Fabric support is not available yet. The Fabric module is only a compile-time stub and does not expose events, APIs, or client synchronization.
The project includes: