Skip to content

API Additions: Create Railway Navigator - #195

Open
DJKieranl29 wants to merge 1 commit into
MisterJulsen:mc/1.20.1-C6-DL3from
kuper-dot:mc/1.20.1-C6-DL3
Open

API Additions: Create Railway Navigator#195
DJKieranl29 wants to merge 1 commit into
MisterJulsen:mc/1.20.1-C6-DL3from
kuper-dot:mc/1.20.1-C6-DL3

Conversation

@DJKieranl29

Copy link
Copy Markdown

I have added a web API that can be toggle-able in the common config for both single player and multiplayer servers.

What it is: A local JSON website built into the mod. Other apps or your browser can read live train info while a world is open.

Turn it on: In config/createrailwaysnavigator-common.toml or via the create config menu for the CRN mod:

[web_api]
    enabled = true

Default address: http://127.0.0.1:8765

In-game: /createrailwaysnavigator api — opens a window; click an endpoint to copy its link.


What you can get:

  • Trains at stations - who’s waiting where, with countdowns
  • Arrivals/departures - recent events (poll or live stream)
  • All trains - Full schedule, next/last stop, delays
  • One train - ?id=<uuid>
  • Station board - next departures from a station (?station=Name)
  • Line colours - all CRN lines and categories

Extra per train: position (x/y/z), line name + colour, distance/countdown to next stop.

Works in: singleplayer and dedicated server (while the world is running).

Safety: Only listens on localhost by default - change bind_address only if you know what you’re doing.

@DJKieranl29 DJKieranl29 changed the title API Additions: Create Railway Navigator - 1.20.1 API Additions: Create Railway Navigator Jun 8, 2026
@JezSonic

JezSonic commented Jun 9, 2026

Copy link
Copy Markdown

Out of curiosity. Will it work using websockets as well? Or do you plan on implementing them?

WebSockets are kind of standard of bidirectional web communication which could really help with live updating everything here.

Nice job otherwise, looking forward to it:)

@DJKieranl29

Copy link
Copy Markdown
Author

I currently has nothing for that, but if this gets approved and added I may consider it in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants