mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-13 04:33:48 -10:00
- `--name` leaves OPTIONS: the game still takes it, but the contract doesn't promise offline play. The guide's first step is now the owner rule, and a session the game can't read is stated as a fact, not an option. - A bad value names its option (`Horizon: --width: invalid digit ...`), since a launcher shows that line to the player. - Session errors say "the session", true for --session-stdin too. - --quickPlaySingleplayer takes one folder name of saves/, as vanilla's level id; a path is refused. --world still takes a path for harnesses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3.3 KiB
3.3 KiB
Launch API reference
What horizon-client promises a launcher that starts it, Launch API 0.1.0. The guide: launch.md; stability and versions: stability.md.
Options
Any other option is refused with exit code 2, so ask --launch-api before passing one a build may not know.
| Option | What it does |
|---|---|
--resources DIR |
The prepared resources (horizon-prepare's output). Default: resources beside the executable, else .local/horizon-client/26.3. |
--game-dir DIR |
The game folder: saves/, options.txt, resourcepacks/, horizon-mods/, screenshots/. Created when missing. Default: the working directory. --gameDir is the same. |
--home DIR |
Logs (logs/latest.log) and crash reports (crash-reports/). Default: HORIZON_HOME, else horizon in the platform data folder. |
--width N |
The window's starting width (default 1280). |
--height N |
The window's starting height (default 720). |
--fullscreen |
Opens the window fullscreen, whatever options.txt says; options.txt is not changed. |
--session-file PATH |
The signed-in account, as the session JSON below. Read once, then deleted. |
--session-stdin |
The same JSON on standard input, so it never touches the disk. |
--quickPlaySingleplayer WORLD |
Opens this world of saves/ at start, only if it exists (else the title screen). WORLD is one folder name: a path is refused. |
--quickPlayMultiplayer HOST[:PORT] |
Joins this server at start. |
--launch-api |
Prints the reply below and exits 0, before anything else runs. |
--launch-api
Prints one JSON object on stdout and exits 0. horizon is the build's version; readers ignore fields they don't know.
{
"crash_report_line": "Horizon: crash report saved to ",
"exit_codes": [
0,
1,
2,
101
],
"horizon": "<version>",
"launch_api": "0.1.0",
"minecraft": "26.3",
"options": [
{
"name": "--resources",
"value": "DIR"
},
{
"name": "--game-dir",
"value": "DIR"
},
{
"name": "--home",
"value": "DIR"
},
{
"name": "--width",
"value": "N"
},
{
"name": "--height",
"value": "N"
},
{
"name": "--fullscreen",
"value": null
},
{
"name": "--session-file",
"value": "PATH"
},
{
"name": "--session-stdin",
"value": null
},
{
"name": "--quickPlaySingleplayer",
"value": "WORLD"
},
{
"name": "--quickPlayMultiplayer",
"value": "HOST[:PORT]"
},
{
"name": "--launch-api",
"value": null
}
]
}
Exit codes
| Code | Meaning |
|---|---|
| 0 | The player quit, or --help or --launch-api printed. |
| 1 | The game stopped on an error. A crash report was saved. |
| 2 | The command line was refused: an unknown option, a missing or bad value. No crash report. |
| 101 | The game panicked. A crash report was saved. |
When a crash report is saved, the last line on stderr is Horizon: crash report saved to followed by the report's path.