Paste a config or current state and hit Load. Export to copy the live state to your mod.
// Minimum: just give it players and a format. { "title": "Saffron City Championship", "format": "double", // "single" | "double" "matchFormat": "BO3", // label shown per match "theme": "neon", // "neon" | "retro" "players": [ { "name": "Ash", "seed": 1, "type": "fire" }, { "name": "Misty", "seed": 2, "type": "water" }, // ...etc. Player count can be anything ≥ 2. // Non-power-of-2 counts get automatic byes for top seeds. ] }
Use any of: normal fire water electric grass ice fighting poison ground flying psychic bug rock ghost dragon dark steel fairy. Or pass a custom hex like "type": "#ff00aa".
{
"config": { /* original config */ },
"matches": [
{
"id": "W1",
"bracket": "W", // W | L | G (grand final)
"round": 1,
"slots": [
{ "name": "Ash", "seed": 1, "type": "fire" },
{ "name": "Joey", "seed": 16, "type": "water" }
],
"winner": 0, // null | 0 | 1
"winnerTo": { "matchId": "W5", "slot": 0 },
"loserTo": { "matchId": "L1", "slot": 0 } // double-elim only
}
],
"champion": "Ash" // or null while in progress
}
Tournament.init(config) // rebuild from a config Tournament.loadState(state) // restore a saved state Tournament.getState() // → serializable state object Tournament.setWinner(matchId, slotIdx)// record a result (0 or 1) Tournament.setPlayer(matchId, slotIdx, { name, seed, type }) Tournament.reset() // clear all results Tournament.simulate() // random play-through (testing) Tournament.on('match', m => …) // fires on every result Tournament.on('complete', s => …) // fires when GF resolves
Hash: tournament.html#config=<base64url JSON>
Query: tournament.html?src=tournament.json (fetched from same dir)
postMessage: send { type: 'tournament:init', config } from a parent frame.
// In your mod (Kotlin/Java): // 1. Build a config from your tournament state. // 2. Write it to a local file or serve over HTTP. // 3. Open the bracket viewer pointing at it: // file:///…/tournament.html?src=./state.json // To push live updates, your mod can: // - Re-write state.json after each battle // - Have the page auto-poll (see autoReload below) // Auto-poll: add &refresh=5 to URL → reload state every 5 seconds.