Skip to content

Feature Settings and Speed

Brennan Hatton edited this page Apr 23, 2026 · 1 revision

Settings page and /dungeontrain speed

Since: v0.11.0 — PR #16

Two knobs on every train — rolling-window carriage count and target speed — are now editable from an in-game settings screen and persisted per-world. The speed value also has its own OP command for quick runtime tweaks.

Settings screen

Accessed via Esc → Mods → Dungeon Train → Config (Forge's Mods menu registers the button automatically). Two fields:

Field Range Default
Carriages [1, 50] 5
Speed (m/s) [0.0, 20.0] 2.0
Train Y [-64, 320] 78

Clicking Save:

  1. Writes the new values to the current world's ServerConfig toml file.
  2. Iterates every active TrainTransformProvider and calls setTargetVelocity / setCount on the integrated server. Live trains accelerate/decelerate immediately and the window resizes on the next tick (if a player is within 128 blocks — see the rolling-window range filter).

Clicking Cancel returns without saving. Out-of-range values are silently clamped on save.

/dungeontrain speed <value>

/dungeontrain speed 0.5    # 0.5 m/s, visibly slow
/dungeontrain speed 20.0   # max

Sets the target speed, persists it to the world's ServerConfig, and applies it to every active Dungeon Train in every server level. Responds with Train speed set to <value> m/s (<N> active train(s) updated).

Persistence

Values are stored as a Forge ServerConfig at:

saves/<world>/serverconfig/dungeontrain-server.toml
[train]
    numCarriages = 5
    speed = 2.0
    trainY = 78

Each world has its own file — changing speed in World A does not affect World B. The file is written atomically on every Save / /dungeontrain speed invocation.

Files

Known limitations

  • Carriage-count changes need a nearby player to take effect (see the rolling-window range filter). The saved value is authoritative, but visible carriages only update when a player comes within 128 blocks of the ship.
  • Settings screen live-update only runs on the integrated server. A dedicated-server client opening Esc → Mods → Config will see and edit the values, but the live-update call finds no trains because Minecraft.getInstance().getSingleplayerServer() returns null. The /dungeontrain speed command works from a dedicated server console.
  • Direction is still hardcoded to +X. Speed is just a scalar multiplier on the velocity vector (speed, 0, 0).

Clone this wiki locally