Fishing · Release 2.1.1
Website Integration
Fishing uses the same delivery approach as DeathSwap 1.0.1: a public JSON snapshot, optional authenticated HTTPS upload to the website host, and an accessible browser widget. Fishing has its own feed, secret and directory so both plugins can run together.
Defaults and timing
plugins/Fishing/web/leaderboards.json is written on startup, after completed matches (including solo scores), after leaderboard resets, and every 30 seconds. It contains up to 100 players per duration, sorted exactly like the in-game boards: best score descending, wins descending, then name. Each row contains rank, UUID, player name, best match score (score) and total wins (wins). No inventories, balances, IP addresses or credentials are included.
The website polls its copy every 30 seconds. This is near-live rather than instant streaming: a result normally appears on the next website refresh after a successful upload. If the Minecraft server or website is offline, the last good feed remains available and its update time shows when data stopped refreshing.
Stat snapshots are read on the Minecraft game thread; file writes and optional HTTPS requests happen on one background worker. New snapshots replace queued older ones, so outages cannot create an unlimited queue. Network failures do not block matches or roll back statistics. Periodic refresh retries with the latest complete snapshot.
Separate Minecraft and website hosts
- Ask your website host to place
website/receive.phpin a dedicated directory such ashttps://www.chillvillemc.com/fishing/receive.php. It requires PHP 8.1+, HTTPS, and write permission in that directory. - Generate a random secret of at least 32 characters. Set it as the website environment variable
FISHING_FEED_TOKEN, separately from Death Swap's secret. The website host may need to forward the Authorization header to PHP. - Add this section to Fishing's
config.yml, using your actual URL and the same secret:
website:
enabled: true
refresh-seconds: 30
top-players: 100
upload:
enabled: true
url: 'https://www.chillvillemc.com/fishing/receive.php'
token: 'REPLACE_WITH_A_RANDOM_SECRET_AT_LEAST_32_CHARACTERS'
- Restart, or run
/fishing admin reloadafter all players have left Fishing. Existing 1.0.0 configs without website settings get safe defaults: local export on, upload off. No arena/stat/player-data migration is required. - The receiver validates authorized POST requests and writes public
leaderboards.jsonbeside itself. Older snapshots are ignored; invalid requests leave the last good feed untouched. Use one Minecraft server as the writer of this feed. - Add
website/leaderboards.jsto the website and the three sections below. The host should disable prolonged caching of the public JSON. Browser visitors never receive the upload secret.
<section data-fishing-board="5"></section>
<section data-fishing-board="10"></section>
<section data-fishing-board="15"></section>
<script src="/fishing/leaderboards.js" defer></script>
To serve the feed elsewhere, add data-feed-url="/your-path/leaderboards.json" to each section. Use a same-origin public URL, or configure your host's CORS deliberately. The widget uses red headings, yellow column labels and white entries on a dark background, matching the in-game colors. It uses text content for player names and accessible table captions/headings. Styling can be adapted to your existing template later.
Feed contract
schemaVersion is 1; plugin is Fishing; pluginVersion is 2.1.1; updatedAt is UTC ISO-8601. Boards are modes["5"].scores, modes["10"].scores, and modes["15"].scores. Each mode also contains name and numeric minutes. Each row has rank, uuid, name, score, and wins. Solo best scores with zero wins are valid; empty boards are empty arrays. The receiver also adds receivedAt and may omit optional plugin metadata.
score is the player's best completed match score for that duration, after extra-line spending. It is not a lifetime point sum or an in-progress match score. wins is the competitive win total for that duration; solo games never increase it. Resets replace the website snapshot, so cleared boards are not left showing old results.
Other hosting options
A host can serve or synchronize the single exported JSON directly if both hosts have a suitable shared/scheduled file-transfer arrangement. Expose only the feed, never the entire plugin directory. A Node, WordPress or other backend can implement the same authenticated POST contract instead of PHP. No incoming Minecraft port, database connection or public Minecraft web server is required.
Uploads use HTTPS with a three-second connect timeout and six-second request timeout, do not follow redirects, and send Authorization: Bearer <token> with UTF-8 JSON. A retry replaces a snapshot; it never increments wins a second time. Keep the token out of public HTML/JavaScript, protect your Minecraft config, and rotate the token on both hosts if exposed.
Set website.enabled: false to stop all future exports/uploads. Old public files remain until the host removes them. Actual website deployment is not configured by installing this update; the package supplies everything the host needs to connect it when your website is ready.
Help: https://www.chillvillemc.com/ Discord: http://discord.chillvillemc.com