Skip to main content
The plugin-api repo includes example plugins that demonstrate the API. You can copy and adapt them for your own plugins.

opponent-tracker

Fetches and displays opponent stats when a game starts. Tracks your personal W/L record against each opponent using persistent storage. API used: players.fetchStatsByUsername(), events.on('opponent:detected'), storage, commands.register()

session-overlay

Shows your session stats on the action bar while in-game, with a configurable update interval. API used: stats.getSessionStats(), stats.getDailyStats(), scheduler.setInterval(), client.sendActionBar(), gameState.isInGame()

auto-glhf

Sends a customizable “glhf” message at the start of each game with a configurable delay. Configurable via /glhf on|off|set <message>|delay <ms>. API used: events.on('game:start'), events.on('opponent:detected'), scheduler.setTimeout(), client.sendGameChat(), gameState.isPrivateMatch, storage, commands.register()

game-logger

Records every game with details (mode, map, result, opponents, duration). View history with /gamelog. API used: events, players.getOpponents(), scoreboard.getTeams(), stats, storage, gameState.getGamePhase(), gameState.bridgeTeam

lobby-spy

Scans lobby players for stats and alerts when high-WLR opponents are detected with a title and sound. API used: players.getLobbyPlayers(), players.fetchStatsByUsername(), scoreboard.getPlayerTeam(), settings.onChange(), packets.onClientbound(), client.sendTitle(), client.playSound()

match-alerts

Plays sounds and titles for game events: starts, victories, defeats, winstreak milestones. Optional auto-requeue after victory. API used: events (game:start, game:victory, game:defeat, lobby:join, server:change), stats.getSessionStats(), scheduler.setTimeout(), client.playSound(), client.sendTitle(), client.sendGameChat(), storage, commands.register()
Example source code lives in the plugin-api/examples/ directory of the repo. Each example is a self-contained plugin you can build and drop into ~/.duelsplus/plugins/ to try.