> For the complete documentation index, see [llms.txt](https://rapidmesck.gitbook.io/cobblemon-kubejs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rapidmesck.gitbook.io/cobblemon-kubejs/readme.md).

# Cobblemon KubeJS Bridge Wiki

Cobblemon KubeJS Bridge exposes Cobblemon data and events to KubeJS scripts. The current implementation targets NeoForge and provides:

* Server-side Pokedex, species, storage, and administrative APIs.
* Server-side Cobblemon lifecycle and battle events.
* Read-only Pokemon and move snapshots.
* A synchronized client-side Pokedex cache for dynamic UI and tooltips.

## Documentation

* [Installation and Getting Started](/cobblemon-kubejs/installation-and-getting-started.md)
* [Server API Reference](/cobblemon-kubejs/server-api.md)
* [Client API Reference](/cobblemon-kubejs/client-api.md)
* [Event Reference](/cobblemon-kubejs/events.md)
* [Data Models](/cobblemon-kubejs/data-models.md)
* [Examples and Recipes](/cobblemon-kubejs/examples-and-recipes.md)
* [Troubleshooting](/cobblemon-kubejs/troubleshooting.md)

## Supported environment

| Dependency | Supported version                           |
| ---------- | ------------------------------------------- |
| Minecraft  | 1.21.1                                      |
| Mod loader | NeoForge 21.1.199 or newer compatible build |
| Cobblemon  |                                             |
| KubeJS     |                                             |

Fabric is currently a compile-only stub. It does not register the KubeJS plugin, bindings, events, or client synchronization.

## Script globals

| Global              | Script side | Purpose                                           |
| ------------------- | ----------- | ------------------------------------------------- |
| `CobblemonJS`       | Server      | Pokedex, species, Pokemon storage, and admin APIs |
| `CobblemonEvents`   | Server      | Cobblemon event listeners                         |
| `CobblemonClientJS` | Client      | Synchronized read-only Pokedex cache              |

## Quick example

```js
CobblemonEvents.pokemonCaptured(event => {
  event.player.tell(`You caught ${event.species} at level ${event.level}!`)
})
```

```js
var caughtFire = CobblemonJS.pokedex.countCaughtByType(player, 'fire')
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rapidmesck.gitbook.io/cobblemon-kubejs/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
