HomeJavaModsRailway
Railway
ModsJava

Railway

by angushushu · on Modrinth

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 1.21.4–1.21.11 · Bukkit⬇ Download for 1.21.4–1.21.11 · Folia⬇ Download for 1.21.4–1.21.11 · Paper⬇ Download for 1.21.4–1.21.11 · Purpur⬇ Download for 1.21.4–1.21.11 · Spigot
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Railway is a Minecraft train operation plugin based on Metro. Building upon the original station management, it introduces Fixed Headway, Train Consists, and Automated Dispatching systems, allowing players to experience realistic arrival, docking, and departure processes.

Core Features

Configuration

The default configuration is located in config.yml. Future updates will extend lines.yml to support per-line service.* fields.

Core Configuration Items

Service Configuration (service)

service:
  mode: local                      # Run mode: local (virtual timetable) | global (always-on entities)
  default_headway_seconds: 120     # Default headway (seconds)
  default_dwell_ticks: 100         # Default dwell time (ticks)
  default_train_cars: 3            # Default consist length (number of cars)
  heartbeat_interval_ticks: 1      # Service heartbeat period (ticks)
  metrics:
    log_interval_ticks: 0          # Service metrics log interval (0 = disabled)

General Settings (settings)

settings:
  default_language: en_US          # Default language (en_US / zh_CN)
  cart_speed: 0.4                  # Default cart speed (can be overridden by line max_speed)
  train_spacing: 1.6               # Spacing between cars in a consist (blocks)
  safe_speed_mode: true            # Automatic speed limit on curves/slopes (prevents derailment)
  
  control:
    default_mode: kinematic        # Global default control mode
    leash:                         # Leash mode configuration
      mob_type: ALLAY              # Leash holder mob type (ALLAY/FOX/WOLF etc.)
      update_interval_ticks: 1     # Leash holder update interval
      offset_y: 0.2                # Leash holder vertical offset
  
  selection:
    tool: GOLDEN_HOE               # Stop area selection tool
    
  interact:
    type: SUBTITLE                 # Display type for rail ETA: ACTIONBAR, TITLE, SUBTITLE
    stay_ticks: 60                 # Display duration in ticks
  
  chunk_loading:                   # Global mode chunk loading strategy
    enabled: true
    radius: 2                      # Loading radius around each car (chunks)
    forward_preload_radius: 1      # Forward preload radius
    only_when_moving: false        # Only load when moving
    update_interval_ticks: 10      # Refresh interval

Travel Time Estimation (travel_time)

travel_time:
  enabled: true                    # Enable Bayesian estimation
  default_section_seconds: 20.0    # Default section travel time
  prior_strength: 4.0              # Prior strength (virtual sample count)
  outlier_sigma: 3.0               # Outlier filtering threshold (sigma)
  decay_per_day: 0.95              # Daily decay factor
  use_unboarded_samples: false     # Whether to use unboarded samples
  unboarded_weight: 0.2            # Unboarded sample weight

Local Mode Configuration (local)

local:
  activation_radius: 96            # Player radius to trigger spawning (blocks)
  spawn_lead_ticks: 120            # Target arrival lead time (ticks)
  suppress_threshold_seconds: 10.0 # Suppression threshold if a train is arriving (seconds)
  virtualization:
    enabled: true                  # Enable virtualization
    idle_ticks: 200                # Time to wait before recycling demand-free trains
    lookahead_stops: 2             # Number of stops to check for demand

Physics Engine Configuration (physics)

physics:
  lead_kinematic: true             # Lead car driven kinematically
  lookahead_blocks: 4              # Rail geometry lookahead blocks
  trail_seconds: 10                # Trail buffer duration (seconds)
  smoothing_lerp: 0.15             # Smoothing interpolation factor (0=instant, 0.3=smooth)
  snap_to_rail: true               # Snap to rail center
  strict_when_has_passenger: true  # Strict alignment when carrying passengers
  position_only_mode: false        # Position-only mode (cinematic/display use)

Station UI Configuration (titles)

Supports stop_continuous (Station HUD), arrive_stop (Arrival), terminal_stop (Terminus), departure (Journey Info), waiting (Waiting for departure) scenarios. See config.yml for full configuration.

Sound Configuration (sounds)

Supports departure, arrival, station_arrival, waiting sound sequences. See config.yml for full configuration.

Scoreboard Configuration (scoreboard)

scoreboard:
  enabled: true                    # Enable scoreboard (Incompatible with Folia)
  styles:
    current_stop: "&f"             # Current stop style
    next_stop: "&a"                # Next stop style
    other_stops: "&7"              # Other stops style
  line_symbol: "●"                 # Line symbol

Tip: The plugin will automatically populate missing keys in config.yml on startup (preserving your existing values). Language files will also automatically merge new entries. No manual config updates are needed for upgrades. Starting from this version, old settings.consist.* settings are deprecated and removed, consolidated into physics.*.

lines.yml example (Planned extension):

red:
  name: Red Line
  color: "&c"
  ordered_stop_ids: [r1, r2, r3, r4]
  terminus_name: "To R4"
  max_speed: 0.6
  service:
    enabled: true
    headway_seconds: 90
    dwell_ticks: 100
    train_cars: 4
    direction_mode: bi_directional   # bi_directional | circular | single_direction
    first_departure_tick: 200

Commands

Basic Commands

Line Management (/rail line)

Stop Management (/rail stop)

All commands support Tab completion.

All command feedback and prompts are integrated into the language system and will output text according to the player's selected language.

Permissions

Lines and stops support an owner and admin system. Permissions can managed via setowner, trust, and untrust commands. OPs and players with railway.admin permission can bypass ownership checks.

Run Modes

Control Modes

All control modes support line speed limits (max_speed), safe speed limits on curves/slopes, and strict passenger synchronization.

Metro Migration Guide

Railway is directly compatible with Metro data files. Migration steps:

  1. Install Railway plugin.
  2. Delete Metro/config.yml (Recommended to use the new config generated by Railway).
  3. Copy Metro/lines.yml and Metro/stops.yml to the Railway/ directory.
  4. Restart server.
  5. Use /rail line list to confirm lines are loaded.

Folia Support

This plugin is declared Folia-compatible (folia-supported: true in plugin.yml). Because performance and scheduler behavior can vary by environment, run full regression and load tests before production rollout.

Physics Reference

TrainCarts, Metro

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more