1. Create the plugin directory
Create a folder under the proxy’s plugins directory:C:\Users\<You>\.duelsplus\plugins\hello-duels\)
2. Add package.json
Createpackage.json with a duelsplus field so the proxy recognizes the plugin:
package.json
id should be unique and usually matches your package name. The proxy loads the file specified by main (here, index.js).
3. Install the API and write the plugin
Install the API for types (and the base class, which the proxy will provide at runtime):index.ts
4. Build and run
Compile TypeScript to JavaScript (e.g. withtsc). Your tsconfig.json can target "outDir": "." so index.js is written into the same folder. Then:
- Ensure the Duels+ Proxy is running.
- Restart the proxy (or start it) so it rescans
~/.duelsplus/plugins/and loads your plugin.
Loaded plugin: Hello Duels v1.0.0 (hello-duels).
5. Try it
- Join a Duels game through the proxy. When the game starts, you should see the green “Game started!” message in chat.
- Type
/helloin chat. The plugin responds with “Hello, <your username>!”.
Next steps
- Events - All available events and payloads
- Commands - Registering and using commands
- Storage - Persisting settings and data
- Client and chat - Sending messages, titles, and sounds