> ## Documentation Index
> Fetch the complete documentation index at: https://developers.duelsplus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Where the proxy and plugins live, and how to set up the API package

## Where things live

* **Proxy** - You run the Duels+ Proxy (separate repo/app). It listens for your Minecraft connection and forwards to Hypixel.
* **Plugins directory** - The proxy loads plugins from:
  * **`~/.duelsplus/plugins/`** (Linux/macOS: `$HOME/.duelsplus/plugins/`)
  * On Windows: `C:\Users\<You>\.duelsplus\plugins\`

Each subdirectory under `plugins/` that contains a valid `package.json` with a `duelsplus` field is treated as one plugin.

## Installing the Plugin API (for development)

Plugins depend on [`@duelsplus/plugin-api`](https://github.com/duelsplus/plugin-api) for **types** and the **Plugin** base class. At runtime, the proxy provides the module itself (you don't ship `node_modules` with your plugin). For local development:

<CodeGroup>
  ```bash npm theme={null}
  npm i @duelsplus/plugin-api
  ```

  ```bash pnpm theme={null}
  pnpm add @duelsplus/plugin-api
  ```

  ```bash bun theme={null}
  bun add @duelsplus/plugin-api
  ```
</CodeGroup>

Then in your plugin code:

```ts theme={null}
import { Plugin, PluginContext } from '@duelsplus/plugin-api';
```

* **Build** your plugin (e.g. `tsc`) and put the compiled output (e.g. `index.js`) in the plugin directory.
* **Restart the proxy** (or ensure the proxy is running) so it rescans `~/.duelsplus/plugins/` and loads your plugin.

## Summary

1. Create a folder under `~/.duelsplus/plugins/<your-plugin>/`.
2. Add `package.json` with `main` and `duelsplus.id` / `duelsplus.name`.
3. Install `@duelsplus/plugin-api` in that folder for types.
4. Write your plugin, build it, and restart the proxy.
